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

 
 


marya mathew samual
how i can creat string array, with global visibility.
0 Answer(s)      2 months and 10 days 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;
          }


}

}
}
View Answers









Related Pages:
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
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
panel visibility
panel visibility  give me an example how may I change panel visibility dynamicly with commandbutton. thanks
Creat a program MinMax.java
of the numbers read in. Do not use arrays. I do not know how to set up the program. Can...Creat a program MinMax.java  Create a program MinMax.java that finds and prints the minimum and the maximum of integers read in from the keyboard
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
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
php parse string into array
php parse string into array  How can i parse a string into array and convert an array into string
array, index, string
array, index, string  how can i make dictionary using array...please help
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
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
array  Hi i have array like {1,2,3,4,,5,5,6,6} then how can i... is an example that store some integers into an array and find the occurrence of each number from the array. import java.util.*; public class SearchNumberOccurrence
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 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
global jdbc file
global jdbc file  hi, I want to create a global connection file.... so anybody from my team can access that class file. can anybody help me out... DatabaseConnection{ public static Connection getConnection() throws Exception { String
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 String array - Java Beginners
java String array  I want to print values stored in array of string ("1","2","3","4","5" ...) in the form 1 2 3 4 5 6 7 8 9 10 11 12 how can it be done ?? Thanks   Hi, public class ArrayTest
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 <
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
PHP Variable Global
PHP Global Variables PHP Global variable are the variables which can be used... can use global variable in different-different ways, For example : PHP Global... variable will refer to the global version. You can declared unlimited numbers
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
PHP Array to String Conversion
PHP Array to String Conversion Sometimes data arrive in array which has to be convert into string, in this situation we can use implode() function which is used to convert the array into string. In PHP, conversion of an array to string
Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array
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
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend...: "); for(int i=0;i<array.length;i++){ array[i]=input.nextInt
Array
Array  How do i insert elements into an array up to a limit from...]; System.out.println("Enter Array Elements: "); for(int i=0;i<array.length;i++){ array[i]=input.nextInt(); } System.out.println
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 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
Global style in Flex4
you can see how we can use global style using simple way and setStyle...Global style in Flex4: You can set the style using global selector. It set the same style property foe all components in the application. You can use
Can I pass a
Can I pass a   Suppose I have servlet named Name.java and there is a variable String name holding a value "Roseindia". I have collected the value to Getname.jsp via ajax. Now how can I pass this value to scriplet without page
String
String  can u resolve anybody my problem is how to remove duplicate characters in string?   import java.util.*; class... < s.length(); i++) { String st = s.substring(i, i + 1
string
string  how do i extract words from strings in java???   Hi Friend, Either you can use split() method: import java.util.*; class...: "); String st=input.nextLine(); String str[]=st.split(" "); for(int i=0
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
array
array  how to getting values and storing values in array by using...(String[] args) throws Exception{ int arr[]=new int[10... Numbers: "); for(int i=0;i<arr.length;i++){ arr[i
String Array
how to make use of string array. In the java programming tutorial string, which... of program: In this program you will be read how to use string of array. First of all... Java String Array      
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
array
array  0 1 2 3 4 5 6 7 8 9 can i have the code for this. the one i had is class ArrayDemo { public static void main(String... s) { int...] = new int[2]; twoD[3] = new int[1]; int i,j,k = 0; for(i=0;i<4;i++) for(j=i;j<
array string
array string  how to sort strings with out using any functions
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
Convert Array to String
Convert Array to String       In this program we have taken an array of type String as "String stringarray[] = {"chandan", " " ,"tamana"
Creat a folder, inside it upload and download files in jsp and mysql
;files.length;i++){ String name=files[i].getName(); String...Creat a folder, inside it upload and download files in jsp and mysql  Create one or more folder .inside it we can upload and download multiple files
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
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 simplify my java code
how can i simplify my java code  /* Create a program that prompts...(h); String s=Integer.toString(i); String t=Integer.toString(i... { public static void main (String [] args) { Scanner kb = new
PHP Array Sub String Search
PHP Array Search Sub-String In PHP if we need to search a sub-string within an array then we can use in_array() function. The format of in_array is much... of $array1 is: array(4) { [0]=> string(5) "India" [1]=>
Convert string into character array
Description: This tutorial demonstrate how to convert a string into array of char. The toCharArray() method converts string to a new character array...;{   public static void main(String[] args) {  

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.