It's not a secret anymore!
The moose likes Java in General and the fly likes Java Inheritance Doubt 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 » Java in General
Reply Bookmark "Java Inheritance Doubt" Watch "Java Inheritance Doubt" New topic
Author

Java Inheritance Doubt

aresh babu
Ranch Hand

Joined: Aug 31, 2008
Posts: 65
Hello,

In java

every class basically extends Object class.

When ever we are extending our class from another class.

Totally our class extends a parent class and an Object class

But we dont have multiple inheritance.

How it happen?


Thanks & Regards

Areshbabu
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35253
    
    7
Totally our class extends a parent class and an Object class

No. All classes extend exactly one other class - either explicitly through an "extends" statement, or -if there is no such statement- implicitly Object is extended. It is not correct to say that both Object and a parent class are extended.


Android appsImageJ pluginsJava web charts
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874

aresh babu wrote:Hello,

In java

every class basically extends Object class.

When ever we are extending our class from another class.

Totally our class extends a parent class and an Object class

But we dont have multiple inheritance.

How it happen?


Thanks & Regards

Areshbabu


No. Object class is extended indirectly through its superclass.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Inheritance Doubt
 
Similar Threads
Java Doesn't support Multiple inheritance
Java does not support multiple inheritance...?
Root Interface & Object class doubt.
Inheritance - Object Class
Object class by default break to rule of multipul inheritance