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...
> 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?