Page 1 of 1

About Question enthuware.ocpjp.v7.2.1732 :

Posted: Tue Apr 07, 2015 4:27 pm
by ThufirHawat
in this question, line number 3 is illegal because:
"An enum cannot extend any other enum or class because an enum is implicitly extends from java.lang.Enum."

Why all my classes extends java.lang.Object and I still can extend another classes?

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

Posted: Tue Apr 07, 2015 8:41 pm
by admin
All classes do not necessarily extend directly from Object. A class is an immediate subclass of Object only if it is not a subclass of any other class.
An enum is a subclass of java.lang.Enum, which in turn is a subclass of Object. The enum itself is not a direct subclass of Object.

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

Posted: Wed Apr 08, 2015 7:28 am
by ThufirHawat
tnx very much!