| Author |
if Object is the super class of all classes then how come it will get inherited to all classes ?
|
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
|
|
Dear All,
if Object is the super class of all classes then how come it will get inherited to all classes.
Suppose my class extends another class and even object class also get inherited .then multiple inheritance will come into picture right..?
|
Creativity is nothing but Breaking Rules
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
|
No. Multiple inheritance means directly extending two or more classes; i.e., class C extends classes A and B both. If class B extends class A, and class C extends class B, then that's not multiple inheritance.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Maximus Moothiringus
Ranch Hand
Joined: Jun 07, 2008
Posts: 46
|
|
So, when our class B extends A, the A will be extending Object and thus we get all the things in Object class, right?
And not B directly extending Object!!
|
-- Maximus Moothiringus
Preparing for SCJA!!
Finally figured out that giving <br/> splits the profile biography but not the signature
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
|
Yes.
|
 |
santhosh.R gowda
Ranch Hand
Joined: Apr 06, 2009
Posts: 296
|
|
|
Thanks a Lot.....
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32694
|
|
You're welcome
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Ernest Friedman-Hill wrote:If class B extends class A, and class C extends class B, then that's not multiple inheritance.
It is called Multilevel inheritence.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
seetharaman venkatasamy wrote:
Ernest Friedman-Hill wrote:If class B extends class A, and class C extends class B, then that's not multiple inheritance.
It is called Multilevel inheritence.
You might call it that, if you like; but this is certainly not a term that is in widespread use (or any use.) What I've described is simply what's understood by the term "single inheritance."
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Ernest Friedman-Hill wrote: What I've described is simply what's understood by the term "single inheritance."
Ok.that is fine
|
 |
 |
|
|
subject: if Object is the super class of all classes then how come it will get inherited to all classes ?
|
|
|