About Question com.enthuware.ets.scjp.v6.2.404 :
Posted: Sun Jan 26, 2014 8:54 am
int[ ] a[ ] = new int [5][4] ;
int[ ] a[ ] = new int[4][ ] ;
In the explanations of the above array declaration/initialization there is nothing said about the second dimension. This may look like there is no difference, but the first one is actually creating references to arrays of length 4 in the first dimension. The second doesn't put these references.
int[ ] a[ ] = new int[4][ ] ;
In the explanations of the above array declaration/initialization there is nothing said about the second dimension. This may look like there is no difference, but the first one is actually creating references to arrays of length 4 in the first dimension. The second doesn't put these references.