About Question enthuware.ocpjp.i.v11.2.3237 :

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
noeloo
Posts: 61
Joined: Sat Feb 15, 2020 8:56 am
Contact:

About Question enthuware.ocpjp.i.v11.2.3237 :

Post by noeloo »

I have a question about the explanation of 5th array declaration:

Code: Select all

char[][] cA = {"1234", "1234", "1234"};
Option 5 creates a one dimensional array and that too of Strings. Note that a java String is not equivalent to a one dimensional array of chars.

I agree that the right side of equals operand does it, but it does not match declaration, so such a line won't even compile. I think it's worth noting.

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

Re: About Question enthuware.ocpjp.i.v11.2.3237 :

Post by admin »

Correct. And as the second line of the explanation notes, "a java String is not equivalent to a one dimensional array of chars.", therefore the right hand side is not equivalent to a two dimensional array of chars. And so the line won't compile.

The explanation has now been enhanced to make this clear.

thank you for your feedback!
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 33 guests