What would be the best way to print out a 2d array and have


JAVA

What would be the best way to print out a 2D array, and have the rows/columns line up, even if some of the elements are null(not initialized) and others are not? For example if I use a nested for loop to print out a 7x7 array...

for(int I = 0; I <7; i++){

for(int2 = 0; I<7; i2++){

System.out.println(array[i][i2])+" ");

}

System.out.println("");

}

Solution Preview :

Prepared by a verified Expert
Business Management: What would be the best way to print out a 2d array and have
Reference No:- TGS02895002

Now Priced at $10 (50% Discount)

Recommended (90%)

Rated (4.3/5)