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 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









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
i need a quick response about array and string...
i need a quick response about array and string...  how can i make a dictionary type using array code in java where i will type the word then the meaning will appear..please help me..urgent
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
Please tell me how can i convert string to timer
Please tell me how can i convert string to timer  Please tell me how can i convert string to timer
how i can print the elements before a spicific value in array queue?
how i can print the elements before a spicific value in array queue?  how i can printall elements befor the spicific value and print this value also   Hi Friend, Try this: <html> <script> var arr=new Array
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
array to string
array to string  hello how to assign value from array to string. nsstring *abc = [array objectAtindex:1];   you can use this codeADS_TO_REPLACE_1 NSString *abc = [NSString stringWithString:[array objectAtIndex:i
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
php parse string into array
php parse string into array  How can i parse a string into array and convert an array into string
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 do I change a large string into hex and then into byte so that SHA1 can be applied to it?
How do I change a large string into hex and then into byte so that SHA1 can..., not the string representing the MEID. If this is true then how do I change my string... 14) to pseudo ESN (a hex number of length 8) calculator, I figured I can make my
How do I initialize a byte array in Java?
How do I initialize a byte array in Java?  How do I initialize a byte array in Java
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
array of string
String[a]; System.out.println(ar.length); for(int i=0;i<ar.length;++i) { ar[i]=s.nextLine(); } for(int i=0;i<ar.length;++i) { String n1=ar[i].substring(0,ar[i].indexOf(" ")); String n2=ar[i].substring(ar[i
JavaScript split string into array
JavaScript split string into array  How to split the string..."; var stringArray = new Array(); stringArray = str.split(" "); for (i = 0; i < stringArray.length; i++) { document.write("<br /> Array
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 based problem
string: "); String[] array = new String[5]; for(int i=0;i<5;i++){ array[i...++){ System.out.print(array[i]+" "); } } static String[] selectionSort(String[] array...string array based problem  R/sir, firstly thanks
how to convert string to char array in java without using tochararray
how to convert string to char array in java without using tochararray  Hi, I want to convert the String object in java without the toChararray() function. how to convert string to char array in java without using
string array sort
string array sort  Hi. How to sort a string array
string array sort
string array sort  Hi. How to sort a string array
string array sort
string array sort  Hi. How to sort a string array
string array sort
string array sort  Hi. How to sort a string array
string array sort
string array sort  Hi. How to sort a string array
array string
array string  how to sort strings with out using any functions
array and string based problem
array and string based problem  this program is accepting only integers as input but i want to modify it such that it can accept both integers..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1
array and string based problem
array and string based problem  this program is accepting only integers as input but i want to modify it such that it can accept both integers..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1
array and string based problem
array and string based problem  this program is accepting only integers as input but i want to modify it such that it can accept both integers..._srt(int array[],int n){ for (int j = 0; j < n; j++){ int i = j-1
array, index, string
array, index, string  how can i make dictionary using array...please help
String Array
how to make use of string array. In the java programming tutorial string, which... Java String Array      ... in this program we are going to use string type array. We have to used array as data
String Array - Java Beginners
, as to by which method can I separate the Integers from this Array of String...String Array  From where can I get, all the functions that are needed for me to manipulate a String Array. For Example, I had a String Array ("3d4
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
how to creat ftp server on java
how to creat ftp server on java  ftp server investigation requirment ER diagram flow chart source code
String Array - Java Beginners
, as to by which method can I separate the Integers from this Array of String...String Array  From where can I get, all the functions that are needed for me to manipulate a String Array. For Example, I had a String Array ("3d4
Array /string based problem....
("Enter string: "); String[] array = new String[5]; for(int i=0;i<5;i...]+" "); } } static String[] selectionSort(String[] array) { for (int i = 1...Array /string based problem....  thanx to help me.but again a problem
Merge Sort String Array in Java
Merge Sort String Array in Java  Hello, I am trying to implement a merge sort algorithm that sorts an array of Strings. I have seen numerous examples of merge-sorting integers but i can not understand how to this with String
Java insertion sort with string array
Java insertion sort with string array In this tutorial, you will learn how to sort array of strings using string array with Insertion Sort. For this, we...++){ System.out.println(sortedArray[i]); } } public static String[] sort_sub(String array[], int
String Array In Java
String Array In Java       In this section, you will learn how to use string array in Java. Here, you will see how to declare a string array and the syntax for using in the program
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
Array List and string operation
Array List and string operation  hi, I want to search an arraylist element in a a given file. example I have a name called "mac" in my arraylist and I have a txt file which contains mac, how many times "mac" appears in the txt
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
C Array of String
C Array of String       In this section you will learn how to create an array of string in C. A String is an array of char objects. An array of string can be declared

Ads