File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Multiple inheritance (was: Raghavendra) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Multiple inheritance (was: Raghavendra)" Watch "Multiple inheritance (was: Raghavendra)" New topic
Author

Multiple inheritance (was: Raghavendra)

raghava rao
Greenhorn

Joined: Dec 03, 2004
Posts: 3
How to achive Multiple Inheritance in Java?

[ EJFH: Added a sensible title ]
[ December 08, 2004: Message edited by: Ernest Friedman-Hill ]
Jimmy Die
Ranch Hand

Joined: Nov 20, 2003
Posts: 97
Hi,


Multiple inheritance is not possible, as classes can extend only 1 other class. Extending a class is defined as inheritance. You can implement multiple interfaces, but interfaces is not a class.


Jimmy Die
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
interesting topic, how does it relate to the question?


42
raghava rao
Greenhorn

Joined: Dec 03, 2004
Posts: 3
Hi Jimmy,
In java, we canot create a class by extending two classes..
Java doesnot support multiple inheritance.

but , what my question is .. is there any way to achive this same concept using interface or something else?

Thanks in advance

Raghav
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Yes and no.

You can implement multiple interfaces but you can not share implementation details with more than one class as interfaces don't contain implementation details.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Multiple inheritance (was: Raghavendra)