About Question enthuware.ocpjp.v7.2.1732 :
Posted: Sun Oct 19, 2014 11:53 am
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.
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
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
}
Is the option 2 actually correct despite of this? If it is so, why?
Thank you