public class TwoDimensions {
	public static void main(String[] args) {
		// declare and initialize one dimension array
		String[] names = new String[] { "San Diego", "Los Angeles", "Anaheim",
				"Thousand Oaks" };
		System.out.println("These are elements of one Dim array.");
		for (int i = 0; i < names.length; i++) {
			System.out.println(names[i] + "   ");
		}
		// declare and initialize two dimensional array
		String dim2[][] = { { "San Diego", "Los Angeles" },
				{ "Stockton", "Santa Barbara" }, { "Oakland", "San Francisco" } };
		System.out.println("These are elements of two Dim array.");
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 2; j++) {
				System.out.println(dim2[i][j]);
			}
		}
	}
}
