This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes if Object is the super class of all classes then how come it will get inherited to all classes ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "if Object is the super class of all classes then how come it will get inherited to all classes ?" Watch "if Object is the super class of all classes then how come it will get inherited to all classes ?" New topic
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
    
  13

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
    
    4
Yes.
santhosh.R gowda
Ranch Hand

Joined: Apr 06, 2009
Posts: 296
Thanks a Lot.....
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32694
    
    4
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
    
  13

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: if Object is the super class of all classes then how come it will get inherited to all classes ?
 
Similar Threads
Reflection
creation of object using new operator
constructors
true or false
Getting the Inherited property of a given class