It's safe to say we will probably be tested on this concept during the SCJP exam. I'm not sure of the answer though.... Array 1: int[][] arrayA = new int[5][10]; - Per my reading material...the first index operator represents five rows...second index represents 10 columns. Array 2: int[][] arrayA = { {1,2,3} , {4,5,6} , {7,8,9} }; - I don't understand the nested curly braces method...please help. - Mike
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
Right, 1. 5 rows 10 columns 2. 3 rows 3 columns as in row 0: 1,2,3 row 1: 4,5,6 row 2: 7,8,9 This is a short way of declaring and initializing an array in one shot ! HIH ------------------ Valentin Crettaz Sun Certified Programmer for Java 2 Platform
You can see this array in this direction for you convienient. int[][] arrayA = { {1,2,3} , {4,5,6} , {7,8,9} }; Now it become 3x3( rows by column ) matrix and in java it contain 0,1,2 rows as well as 0,1,2 column.