• Post Reply Bookmark Topic Watch Topic
  • New Topic

if Object is the super class of all classes then how come it will get inherited to all classes ?  RSS feed

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Maximus Moothiringus
Ranch Hand
Posts: 46
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot.....
 
Campbell Ritchie
Marshal
Posts: 56598
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote: What I've described is simply what's understood by the term "single inheritance."


Ok.that is fine
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!