About Question enthuware.ocpjp.v7.2.1418 :

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
mouadA
Posts: 2
Joined: Fri Dec 27, 2024 8:08 am
Contact:

About Question enthuware.ocpjp.v7.2.1418 :

Post by mouadA »

There is an error in the explanation of the following option in this question

Code: Select all

switch(s)
{
    case Switch.OFF -> System.out.println("It is off!"); break;
}
in the explanation they say that
1. An enum switch case label must be the unqualified name of an enumeration constant. So it should becase OFF instead of case Switch.OFF.
witch is wrong for java 21, since Java 21, using <enum name>.<constant>is also valid.

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

Re: About Question enthuware.ocpjp.v7.2.1418 :

Post by admin »

You are right. The explanation has now been fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests