About Question enthuware.ocpjp.v7.2.1462 :

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
renatumb
Posts: 47
Joined: Mon Apr 08, 2013 7:55 pm
Contact:

About Question enthuware.ocpjp.v7.2.1462 :

Post by renatumb »

I got "You answered correct", but I think my answer is wrong

public enum Seasons { SUMMER, WINTER } // my answer

class TestClass{

public TestClass(){
}
}

I think I could use protected, public or private just if the enum were inside of class TestClass{...}, right ?

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

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

Post by admin »

No, public is valid in this case because the question says the file name is Seasons.java

Danny Sheridan
Posts: 30
Joined: Sat May 02, 2015 4:48 pm
Contact:

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

Post by Danny Sheridan »

One of:
enum Seasons {}
enum Seasons {WINTER}
enum Seasons {SUMMER}

They are not taken as correct answers but wouldn't they satisfy the specs in the question also?

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

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

Post by admin »

Yes, you are right. Technically, they are valid. I have updated the question statement accordingly.
thank you for your feedback!
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests