Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1387 :

Posted: Tue Jan 27, 2015 2:16 am
by gparLondon
Size of the dimensions is required to specified only at the time of instantiation and not at the time of declaration. For example, int[][] ia; //this is a valid declaration. int[][] ia = new int[2][3];//this is a valid declaration and a valid instantiation.
Just a little suggestion in the example also int[][] ia=new int[3][] is also valid,

as the choice 3, sasy
The number of rows and columns must be specified at the time it is declared.
Thanks,
GPAR

Re: About Question enthuware.ocajp.i.v7.2.1387 :

Posted: Tue Jan 27, 2015 9:18 pm
by admin
Added.
thank you for your feedback!

Re: About Question enthuware.ocajp.i.v7.2.1387 :

Posted: Tue May 19, 2015 12:00 am
by pbonito
It seems that only the first dimension should be decalred in multidimensional array:
int [] [][]arr = new int[2][][];

but in choice 3 I read:
the last dimension can also be left out at the time of instantiation for an array of more than one dimension.

Thanks

Re: About Question enthuware.ocajp.i.v7.2.1387 :

Posted: Tue May 19, 2015 4:24 am
by admin
You are right the explanation is incorrect. Fixed.
thank you for your feedback.
Paul.