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

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
gparLondon
Posts: 63
Joined: Fri Oct 31, 2014 6:31 pm
Contact:

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

Post 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

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

Added.
thank you for your feedback!

pbonito
Posts: 13
Joined: Sat May 16, 2015 12:38 pm
Contact:

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

Post 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

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

You are right the explanation is incorrect. Fixed.
thank you for your feedback.
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests