Thread: 2D array
View Single Post
  #3 (permalink)  
Old 01-15-2008, 06:57 PM
bluekswing bluekswing is offline
Member
 
Join Date: Jun 2007
Posts: 14
bluekswing is on a distinguished road
Thanks for the response! I ended up just doing the following:

Quote:
row = 5;
col = 10;
rowCount=0;

while (row > 0) {

String[][] array = new String[row][col];
String[] array1 = new String[col];

for (int i = rowCount; i<=rowCount; i++) {
for (int j = 0; j<array[i].length; j++) {

array1[j] = array[i][j];

} //end of inner for loop

} //end of outer for loop

//instantiate object - pass array1 into the constuctor
//build object
//do stuff with object


rowCount++;
row--;
} //end of while

Last edited by bluekswing : 01-15-2008 at 07:13 PM. Reason: fixed code
Reply With Quote