1

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.

2
  • The two statements you quoted are in complete agreement. Unclear what you're asking. Commented Oct 23, 2016 at 9:04
  • I'm only not sure :) I'm want to be verified :) Commented Oct 23, 2016 at 10:01

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

ok, thank, I'm only not sure my anwer, Now it is more obvious. Thanks.
0

What they are trying to say is this:

This declaration:

class Foo
{
    ...         
}

Is the same as this one:

class Foo extends Object
{
    ...         
}

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.