on 09-14-2008 11:15 AM
Hi All,
I would like to know about the major advantages of the interfaces and Could java acheive 100% multiple inheritance through interfaces?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sriram,
multiple inheritance in java is achieved by extending more than one interface.
thanks,
GLM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.