wood burning stoves 2.0*
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
Author

Interface

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
Mike
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


Dave
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: http://aspose.com/file-tools
 
subject: Interface