Strings and array

Hi I want to create simple java program, witch I will use to keep some strings like names and so on. string book[][] = new string[5][5]; How can I put those strings in to string array, I want to use for loop. Thanks guys
[248 byte] By [vall75a] at [2007-11-27 10:00:05]
# 1

One way to stuff strings in the array would be at declaration time:

String[][] book =

{

{"up", "down"},

{"charm", "strange"},

{"top", "botton"}

};

If you wanted to insert the strings later using for loops or nested for loops, it would all depend upon where you are getting the strings: a file, keyboard input, etc...

petes1234a at 2007-7-13 0:31:15 > top of Java-index,Java Essentials,New To Java...
# 2

> I want to use for loop.

String[][] book = new String[5][5];

for (int ix = 0; ix < book.length; ix++) {

for (int jx = 0; jx < book[ix].length; jx++) {

book[ix][jx] = ... something ...;

}

}

By the way, what will this 2D array called book represent?

jverda at 2007-7-13 0:31:15 > top of Java-index,Java Essentials,New To Java...
# 3
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
jverda at 2007-7-13 0:31:15 > top of Java-index,Java Essentials,New To Java...
# 4
If you want to use one dimensional array then:String[] name = new String[10];For 2 dimensionalString[][] = new String[10][];I think one dimensional array is enough for your requirenment.
Friend4evera at 2007-7-13 0:31:15 > top of Java-index,Java Essentials,New To Java...