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?
About Question enthuware.ocpjp.v7.2.1732 :
Moderator: admin
-
- Posts: 28
- Joined: Wed Feb 25, 2015 9:03 am
- Contact:
-
- Site Admin
- Posts: 10388
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1732 :
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.
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.
-
- Posts: 28
- Joined: Wed Feb 25, 2015 9:03 am
- Contact:
Re: About Question enthuware.ocpjp.v7.2.1732 :
tnx very much!
Who is online
Users browsing this forum: No registered users and 5 guests