/* Author : Michael Robinson Program : array2dimLength.java Purpose : To present a two dimension array of int data type Updated : Jan 29, 2099 */ public class array2dimLength { public static void stringLoadDisplay2d() { //load 2D array with strings String names[][] = { { "Joe", "Smith" }, { "Maria", "Perez" }, { "James", "Einstein" } }; int x = 0; int y = 0; System.out.println( " names.length = " + names.length + "\n" ); //process rows based on array's length for( x = 0; x < names.length; x++ ) { for( y = 0; y < 2; y++ ) //process columns { System.out.print( " " + names[x][y] ); //display data } System.out.println(); //display a line feed } }//end public static void stringLoadDisplay2d() public static void main( String arg[] ) { stringLoadDisplay2d(); }//end public static void main( String arg[] ) }//end public class array2dimLength