Didn't the example above help? OK. How to copy two one-dimensional arrays into a single two-dimensional array:
Code:
public class TwoBecomeOne {
public static void main(String[] args) {
String[] s1 = {"A1", "A2", "A3"};
String[] s2 = {"B1", "B2", "B3"};
Object[][] o = {s1, s2};
displayArray(o);
}
public static void displayArray(Object[][] array) {
for (int i = 0; i < array.length; i++) {
for (int j = 0; j < array[i].length; j++) {
System.out.print("\t" + array[i][j]);
}
System.out.println();
}
}
}
This works because the 2D Object array may hold two references to two 1D String arrays.
Bookmarks