Wednesday, May 18, 2011

Assigning 1D array to row of 2D array

int myArray[][] = new int [4][4];
myArray[0] = new int[] {1, 9, 4,7,8} ;
int[] x = {1, 7, 4,5,6,7,6,90,4,5,6,7,8,9,0,1,3,4,5} ; // declare and init x
myArray[1]=x;

No comments:

Post a Comment

Chitika