public class TwoDimArray1 { public static void main(String[] args) { double[][] a = { { 1.0, 2.0, 3.0, 4.0 }, { 2.0, 5.0, 1.0, 7.0 }, { 4.0, 1.0, 2.0, 8.0 } }; int i, j; // Array indices /* ----------------- Print 2-dim array a -------------------- */ // Print elemenst in row i for ( i = 0 ; i < a.length ; i++ ) { // Print element j in row i for ( j = 0 ; j < a[i].length ; j++ ) { System.out.print( a[i][j] + " " ); } System.out.println(); } } }