About Question enthuware.ocpjp.v7.2.1732 :

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
logtwo
Posts: 2
Joined: Sun Oct 19, 2014 11:23 am
Contact:

About Question enthuware.ocpjp.v7.2.1732 :

Post by logtwo »

Hi,
I'm a bit confused about line being 2 an error due to method clone() being declared final in Enum class, as solution says.

Code: Select all

 public enum EnumB{ B, BB, BBB;      
public Object clone(Object o){ return B; } //2    
}
If I'm not wrong, line marked as //2 is not an override of Object.clone() method, but rather an overload of it, since parameters are different (one Object vs no parameters at all in Object's method).

Is the option 2 actually correct despite of this? If it is so, why?

Thank you

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

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

Post by admin »

You are right. The given clone method should not have any parameter. Fixed.
thank you for your feedback!
Paul.

Veritas
Posts: 12
Joined: Thu Aug 21, 2014 9:34 am
Contact:

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

Post by Veritas »

looks like a typo in the explanation
6. (...) with an enum constant and returns that constant if successful (...)

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

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

Post by admin »

You are right. Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests