I guess that answer may be "a class is not explicitly inherit, will implicit inherit Object class". But i'm not sure, in Oracle Doc, ... they all said : all class object implicit inherit Object class.
-
The two statements you quoted are in complete agreement. Unclear what you're asking.user207421– user2074212016-10-23 09:04:58 +00:00Commented Oct 23, 2016 at 9:04
-
I'm only not sure :) I'm want to be verified :)Tuan Nguyen Dinh– Tuan Nguyen Dinh2016-10-23 10:01:23 +00:00Commented Oct 23, 2016 at 10:01
2 Answers
A class always has a single direct super-class, but it can have multiple ancestor classes (if class C extends B and class B extends A and class A extends Object, C has a single direct super-class - B - and 2 indirect super-classes - A and Object). If you don't specify the super-class in your class definition, the direct super-class will be the Object class by default.
If you specify a direct super-class in your class definition, that class would be the only direct super-class of your class. Object will still be an ancestor of your class, but it won't be the direct super-class of it.