Skip to Content
avatar image
Former Member

advantages of interfaces

Hi All,

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Sep 14, 2008 at 02:20 PM

    Hi Sriram,

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

    thanks,

    GLM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 03, 2008 at 03:11 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 03, 2008 at 07:11 PM

    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

    Add comment
    10|10000 characters needed characters exceeded