static void foo(){ Vector<String []> vector = new Vector<String []>(); String array1[] = {"word1","word2","word3"}; String array2[] = {"word4","word5","word6"}; String array3[] = {"word7","word8","word9"}; vector.add(array1); vector.add(array2); vector.add(array3); printall(vector); String newarray[] = vector.get(1); newarray[0]="newword"; printall(vector); } static void printall(Vector<String []> vector){ System.out.println("\n"); for(int i =0; i < vector.size();i++){ for(int j=0; j < vector.get(i).length ; j++){ System.out.println(vector.get(i)[j]); } }
Monday, June 13, 2011
Modify a String element of a Vector String Array
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment