/**
 * A simple example of an array of arrays (cont.)
 */
 public class Sports2
 {
    public static void main(String[] args)
    {
			int          game, points, week;
			int[][]      pointsScored;        // Note the declaration


			// Create an "group" of arrays.  There are
        	// 3 arrays in the "group".
		pointsScored    = new int[3][];

			// Create array zero.  There are 2 elements
			// in the array.
		pointsScored[0]    = new int[2];
		pointsScored[0][0] = 58;          // Note the use of [][]
		pointsScored[0][1] = 60;          // Note the use of [][]

			// Create array one.  There are 4 elements
			// in the array.
		pointsScored[1]    = new int[4];
		pointsScored[1][0] = 72;
		pointsScored[1][1] = 48;
		pointsScored[1][2] = 61;
		pointsScored[1][3] = 44;


			// Create array two.  There are 3 elements
			// in the array.
		pointsScored[2]    = new int[3];
		pointsScored[2][0] = 60;
		pointsScored[2][1] = 63;
		pointsScored[2][2] = 51;


			// Note the use of pointsScored.length
		for (week=0; week < pointsScored.length; week++)
		{
	 	   System.out.println("\nWeek: "+week);

	  
	  		 	 // Note the use of pointsScored[].length
	    	  	// (Watch for ArrayIndexOutOfBounds problems)
	    	for (game=0; game < pointsScored[week].length; game++)
	    	{
				System.out.print("  Game "+game+": ");

					// Note the use of [][]
				System.out.print(pointsScored[week][game]);
	    	}
		}
    }

}
