aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Is this multiple inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Is this multiple inheritance" Watch "Is this multiple inheritance" New topic
Author

Is this multiple inheritance

Mani
Ranch Hand

Joined: Apr 20, 2000
Posts: 50
interface a
{
}
interface b
{
}
interface c extends a,b
{
}
public class temp
{
public static void main(String args[])
{
System.out.println("test message");
}

}
See interface c.Can we say this is multiple inheritance??
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
IMO -
I think the term "multiple inheritance" is applicable
only for classes and not for interfaces. Here you are
creating a hierarchy of interfaces.
Since c itself is declared as an interface and not
a class, compiler does not apply the multiple inheritance
check here. If you declare c as a class and try to
compile your code, among other error messages is one
which says Multiple inheritance is not supported.
I hope this substantiates my argument
However, I am very curious to know if creating
such (multiple)inheritance interface hierarchies
is a good design practice. Also, is there any
example for such interface(s)?
Ajith

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
Consider Paul's rocket mass heater.
 
subject: Is this multiple inheritance