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



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

Have Programming Question? Ask it here!
 
 
 


marya mathew samual
how i can creat string array, with global visibility.
0 Answer(s)      a year and 5 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 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 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 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
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
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 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 i can get jqfade.js library
how i can get jqfade.js library  how i can get jqfade.j script library
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 can i make monthly register ?
how can i make monthly register ?  how can i make monthly register ? iam using jdeveloper
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 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
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.
How can I to my database to my application
How can I to my database to my application  How can I to my database to my application   Hi, Please see the JDBC discussion thread. Thanks
php parse string into array
php parse string into array  How can i parse a string into array and convert an array into string
panel visibility
panel visibility  give me an example how may I change panel visibility dynamicly with commandbutton. thanks
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 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 modify my account in roseindia
How can i modify my account in roseindia  Presently am not using my gmail id. I have to modify my roseindia account. Please send the answer to following mail id
how can i simplify my java code
how can i simplify my java code  /* Create a program that prompts...=Integer.toString(f); String q=Integer.toString(g); String r=Integer.toString(h); String s=Integer.toString(i); String t=Integer.toString(i
how can i hide and show tables
how can i hide and show tables  hai, i am creating a form which the code is included below i want to hide the tables initially and after i click go i want to display the tables with result.so any help is appreciated much <
How can I create sessionfactory in Hibernate?
How can I create sessionfactory in Hibernate?  HELLO, How can I create sessionfactory in Hibernate? If you can explain me with example that would... with the links below: Hibernate 4 Hibernate Session Factory I hope
How can i use Facebook connect button
How can i use Facebook connect button  Please to meet you all guys I wonder how can i use this Connect to facebook for me to post in a particular... http://likekhevy4.blogspot.com/ How can i apply this kind of comment with "Connect
how can i close a frame. - Java Beginners
how can i close a frame.  Hi, My question is how can we close... frames as i go on clicking button...........can we have like when i click on button...............my target is when i click on that button, a new frame is coming and updated table
how can i print the selected content of a frame
how can i print the selected content of a frame  hello sir, I am designing a bill calculate program. I want to print the bill in crystal form. I want to skip all the text fields shapes and all the button from the frame.. but all
How can I change UIButton title color?
How can I change UIButton title color?  Hi, I have a button in my iPhone/iPad application. I want to change the color of the text when user clicks on it making it selected. Provide me good example code. Thanks   Hi
how can i set an object in focus
how can i set an object in focus  There is a Canvas object in my game... on the Board . Basically i am working on snake game project, and i want is when... i am facing is after clicking button gamescreen appearing on window but snake
Java Array Values to Global Varibles - Java Beginners
Java Array Values to Global Varibles  I am working on a program that provides users with 3 loan options. If global variables rate and periods... your problem so that I can better understand your problem.. Try this code
How can i search and insert within a query
How can i search and insert within a query  if it is possible... semester and degree if i search batch 2008 , semester first and degree bscs then search..., terminal) in another table. i am trying these but not successful, A problem occur
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
array string
array string  how to sort strings with out using any functions
 

 

 

DMCA.com