/********************************************************************* * Author: Eric Heim * Date Created: 6/20/2011 * Course: CS0007 * Description: Shows the difference between the length field on the * entire two dimensional array as opposed to a single * row *********************************************************************/ public class TwoDimLengths { public static void main(String[] args) { int[][] numbers = {{1,2,3}, {4,5,6}, {7,8,9}, {10,11,12}}; System.out.println("The number of rows in the array is " + numbers.length); for(int i = 0; i < numbers.length; i++) { System.out.println("The number of columns in row " + i + " " + "is " + numbers[i].length); } } }