how i can creat string array, with global visibility.
Problem :
Write a Java class having a String array, with global visibility.
Add a method that adds a given sting to the string array.
Add a method that searches for a given string in the string array.
Add a method that searches for a given character in the string array. The method should count and returns the occurrence of the given character.
Write an appropriate main method to test these class methods.
here is my solution where i reach so far:
package ooplab3;
public class StringArray {
String[]sTA=null;
private int index=0; //last adding string postion in String array
public static String [] testArray; {
}
public void setCounter(int counter) {
this.index = counter;
}
public String getsTA index(int i) {
return sTA;
}
public void AddStringtoArray(String st) {
if(this.index < sTA.length){
sTA[this.index]=st;
this.index++;
}
}
public int searchStringInArray(String sT, int i){
int n=0;
for(int i=0; i<this.index;i++)
for(int j=0;j<10;j++)
sTA[i].indexOf(sT);
n+=searchInString(sTA[i]);
return 0;
}
public int searchcharInArray(String sT){
int n=0;
int Startindex=0;
do{
n+=sT.indexOf(occ,starindex);
}
{
while(next !=(int)'\n')
{
outfile.print((char)(next));
return n;
}
}
}
}
View Answers
Ads
Related Tutorials/Questions & Answers:
how i can creat string array, with global visibility.
how i can creat string array, with
global visibility. Problem :
Write a Java class having a
String array, with
global visibility.
Add a method that adds a given sting to the
string array.
Add a method that searches
how i can creat string array, with global visibility.
how i can creat string array, with
global visibility. Problem :
Write a Java class having a
String array, with
global visibility.
Add a method that adds a given sting to the
string array.
Add a method that searches
Advertisements
If Sessin Contain Array how can i get each value.
If Sessin Contain
Array how can i get each value. sir,
i m trying to get value form session and session contain
array i mean ..
whatever... to use this value in different conditions..so
how can i get it..
Thank u
How can I get query string values in JavaScript?
How can I get query
string values in JavaScript?
How can I get query
string values in JavaScript?
To get a query
string value, you
can use JQuery and JavaScript.. here is the code:
function getParameterByName(name
How to declare String array in Java?
Following example will show you
how to declare
string array in java. There
are many ways to declare an
array and initialize them. We
can use 'new' keyword
to declare an
array. However, an
array can also be declared without
how to convert string to char array in Java
how to convert
string to char
array in Java Hi,
I have a
string...
String object to char
Array in Java?
how to convert
string to char
array...
String object to char
Array:
1) Create char
array with the size of
String Object
How to convert Arraylist into String Array Java
How to convert Arraylist into
String Array Java Hi,
I am beginners of Java programming.
Can somebody Suggest me
how to convert arraylist to
string array in Java. Please suggest any online example.
Thanks
Hi,
I
how to creat a new program
how to
creat a new program what is use of abs class in realtime projects..
how to
creat the program step by step
How can I do it? .click();
How can I do it? .click();
I have a very unusual problem.
I want...("a");
x.click();
</script>
So it's click on an element witch one Id's is "a", but
I want that it make mouseup in this element.
How can I do it, because if
I write
How can I learn Java?
How can I learn Java? Hi,
I have just completed a course in HTML and C programming language.
I have some programming experience in visual basic... programming.
How can I learn Java? in shortest possible time.
I mean
I just want to begin
how should i can solve
how should
i can solve Web based program -
Input - Person's contact details with Passport Number as Unique Key.
Save data in to oracle / MySQL.
Output - List of Persons saved in the database.
Technology to be used - JSP
how do i begin a two dimensional array?
how do
i begin a two dimensional
array? I'm new to java programming and need to create a two dimensional
array that enters exactly what is entered in the first dimension and then the first non-white space character of what
string array
string array Hi
hw to print
string array element in ascending r...);
System.out.println("
Array Elements in Ascending Order: ");
for(int
i=0;i<... StringArray
{
public static void main(
String[] args)
{
String arr
how can i display a pdf file in a jtextarea
how can i display a pdf file in a jtextarea
I need to display a pdf file in a jtextfield or in a jtextarea.Atlest
i need to displat it in a jframe.I have a button and while clicking on it ,
i need to choose the pdf file and need
how can i display a editable result of form?
how can i display a editable result of form?
how can i display a editable result of form?
i know
how to display form result but the result... show the result but
i can not modify the result.
how can i display modifyable
how can i create a discussion forum?
how can i create a discussion forum?
how can i create a discussion forum for my e- mentoring site for women which
can be used by a registered user only.
i am using jsp and servlets and
i am working with netbeans 6.8.