Hi,
The two dimensional array works OK from one class.
From class Oracle,
public static String strLine[]= new String[11]; // 11 fields - first, middle, last name, etc.
public static String[][] arryMain= new String[5][5]; // hold array of strLines
// I can print out both records OK.
public static String[][] getArryMain(){
return arryMain;
}
Getting the two dimensional array from another class,
String[][] newLine = Oracle.getArryMain();
for (int j=0;j<2; j++) // There are only two records in this example
{
System.out.print("Record Number: ");
System.out.println(j);
for (int k=0;k<11; k++)
{
System.out.println(newLine[j][k]);
}
}
Record Number: 0
hi
M
Carver
33 Richards Street
Honolulu
...
Record Number: 1
hi
M
Carver
33 Richards Street
Honolulu
...
This show that both records have the same information. The last record gets placed
in both positions.
Thanks.
but
try
for (int j=0;j<array.length; j++)