aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes JAVA SUPPORTS  MULTIPLE INHERITANCE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "JAVA SUPPORTS  MULTIPLE INHERITANCE" Watch "JAVA SUPPORTS  MULTIPLE INHERITANCE" New topic
Author

JAVA SUPPORTS MULTIPLE INHERITANCE

Nikhilesh Fonseca
Ranch Hand

Joined: Aug 23, 2004
Posts: 57
I was wondering since every object extends from Object Class ..so if one class extends from another it already extends from the Object class.
Shouldnt this line be more Java doesnt support user defined multiple inheritance..
Dave Alkire
Greenhorn

Joined: Jun 25, 2004
Posts: 10
No, that would be like saying that Kitty is two different things at once because he's both a cat and an animal. But he isn't two different things at once, because Cat is-a Animal. Now to say that Kitty were simultaneously a cat and a horse, that would be like multiple inheritance.


-Dave A.
S Santhosh
Ranch Hand

Joined: Mar 03, 2005
Posts: 73

| |
| |



C extends A and C extends B, where A and B are different entities. Then C has multiple inheritance.

Sreeds
[ March 25, 2005: Message edited by: San Sreeds ]
Kaustubh Patil
Ranch Hand

Joined: Aug 13, 2001
Posts: 164
poor kitty !!!

Sorry.. guys.. couldn't help but add a little humor.


Kaustubh. Mumbai, India.
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I have about 70 books on my shelf on the Java programming language (a bit excessive I know) starting with one published around 1997 and they all say Java does not support Multiple Inheritance. Now they might all be wrong but...


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
Java supports only interface inheritance.
You may inherit zero or more interfaces, which have only abstract (no impl) methods.
Java does not support multiple concrete inheritance.
A Java class has one and only one superclass, not zero, not two.
The only exception to this rule is for java.lang.Object, which has zero superclasses.
A Java class inherits from java.lang.Object, directly or indirectly, through concrete inheritance. Each leaf node of the tree has one and only one parent.

Frankly, I don't understand why:
a) this trivial concept is so difficult to grasp
b) this concept continues to be the focus of discussion even after the language has matured


Tony Morris
Java Q&A (FAQ, Trivia)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA SUPPORTS MULTIPLE INHERITANCE