enthuware.ocpjp.v11.2.3061

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
Seán Kennedy
Posts: 12
Joined: Wed Feb 17, 2021 6:55 am
Contact:

enthuware.ocpjp.v11.2.3061

Post by Seán Kennedy »

Hi,
Just wondering about the second parts of the answers to options b and e. It seems to imply that "var i = " is required to get the code to compile and that "var i[] = " will be an issue (especially option e which says instead of). See attached file.

Kind regards,
Seán.

PS. When I click Discuss on this question I am being brought to "v6.2.736".
Attachments
enthuware.ocpjp.v11.2.3061.PNG
enthuware.ocpjp.v11.2.3061.PNG (8.77 KiB) Viewed 3879 times
Last edited by Seán Kennedy on Sat Mar 27, 2021 7:51 am, edited 1 time in total.

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

Re: enthuware.ocpjp.v11.2.3061

Post by admin »

Right, neither of the following will compile.
var i[] = new int[] {1, 2} ;
var[] i = new int[] {1, 2} ;
Because 'var' is not allowed as an element type of an array

var i = new int[] {1, 2} ; otoh, is ok and declares i to be of type int[].
If you like our products and services, please help us by posting your review here.

Seán Kennedy
Posts: 12
Joined: Wed Feb 17, 2021 6:55 am
Contact:

Re: enthuware.ocpjp.v11.2.3061

Post by Seán Kennedy »

Sorry, I must be missing something. The screenshot is from Netbeans and I got no compiler errors?

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

Re: enthuware.ocpjp.v11.2.3061

Post by admin »

Seán Kennedy wrote:
Sat Mar 27, 2021 7:57 am
Sorry, I must be missing something. The screenshot is from Netbeans and I got no compiler errors?
Not sure why your NetBeans is not showing the error. Mine is. See attached.

Btw, you are breaking the first (or second or third :D ) rule of certification preparation - don't use IDE. Use command line.
test.png
test.png (6.01 KiB) Viewed 3874 times
If you like our products and services, please help us by posting your review here.

Seán Kennedy
Posts: 12
Joined: Wed Feb 17, 2021 6:55 am
Contact:

Re: enthuware.ocpjp.v11.2.3061

Post by Seán Kennedy »

Thanks very much. I am getting those errors in javac. My own personal first rule for certification preparation is Enthuware! :)

Thanks again,
Seán.

Post Reply

Who is online

Users browsing this forum: No registered users and 48 guests