File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Interface" Watch "Interface" New topic


Mike Shn
Ranch Hand

Joined: May 26, 2001
Posts: 149
Does it possible in Java for interface to use Multiple inheritance?
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
There is no multiple inheritance in Java. However, using interfaces you can simulate it. Interfaces let you extend multiple interfaces but not to extend multiple classes.
Put another way:
Both a class or an interface can inherit from more than one interface. A class, however, can only inherit from one other class.
Check out the following code:

hope that helps a little bit

Shivaji Marathe
Ranch Hand

Joined: Jan 11, 2002
Posts: 203
Actually it is also possible to write code where one interface extends several others. Code like this compiles at least in JDK 1.3.1
Such as
interface InterBase extends InterSuper, InterAnother {
// methods here.
I agree. Here's the link:
subject: Interface
It's not a secret anymore!