Cell[][] mat = new Cell[3][5]; for ( int i=0; i<3; i++ ) { for ( int j=0; j<5; j++ ) { mat[i][j] = new Cell( i, j, 100 ); } }