Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners how i can creat string array, with global visibility.
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


marya mathew samual
how i can creat string array, with global visibility.
0 Answer(s)      a year and 9 months ago
Posted in : Java Beginners


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


}

}
}

Advertisement
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
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
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 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 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
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
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
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 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 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 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
array to string
array to string  hello how to assign value from array to string. nsstring *abc = [array objectAtindex:1];   you can use this code NSString *abc = [NSString stringWithString:[array objectAtIndex:i]]; where i
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
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 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
How can I protect my database password ?
How can I protect my database password ?   How can I protect my... in as plain text. What can I do to protect my passwords... a database over the internet. I have concerns about the security of the database
how can i add hibernate plugin to eclipse?
how can i add hibernate plugin to eclipse?  how can i add hibernate plugin to eclipse
how i can get jqfade.js library
how i can get jqfade.js library  how i can get jqfade.j script library
how can i make monthly register ?
how can i make monthly register ?  how can i make monthly register ? iam using jdeveloper
how can i remove newline characters and tabs
how can i remove newline characters and tabs   how can i remove newline characters and tabs ? but i wont to using GUI .please help
 

 

 

DMCA.com