cancel
Showing results for 
Search instead for 
Did you mean: 

advantages of interfaces

Former Member
0 Kudos

Hi All,

I would like to know about the major advantages of the interfaces and Could java acheive 100% multiple inheritance through interfaces?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

The basic use of an interface is to implement multiple inheritence and you have all the abstract methods in an interface and by implementing this interface you can use those abstract methods.

One benefit of using interfaces is that they simulate multiple inheritance. All classes in Java (other than java.lang.Object, the root class of the Java type system) must have exactly one base class; multiple inheritance of classes is not allowed. However, a Java class/interface may implement/extend any number of interfaces.

Regards

Manohar

Former Member
0 Kudos

Hi sriram,

You can refer the following links for the advantages of interfaces.

http://benpryor.com/blog/2006/08/23/java-advantages-of-interfaces/

/message/2625906#2625906 [original link is broken]

http://en.wikipedia.org/wiki/Interface_(Java)

Regards

Sagar Ingalwar

Former Member
0 Kudos

Hi Sriram,

multiple inheritance in java is achieved by extending more than one interface.

thanks,

GLM