How can we achieve Multiple Inheritance in Java ?

Discussion in 'Object Oriented Concepts' started by vbraojava, Sep 15, 2008.

  1. vbraojava

    vbraojava New Member

    Directly we can't achieve Multiple Inheritance in Java.

    Indirectly there are two ways, those are :

    1. We can achieve Multiple Inheritance by implementing more than one Interfaces, because we can have chance to implement more than one Interfaces in Java.

    2. Another indirect way to achieve Multiple Inheritance is, doing by repeated use of Single Inheritance.

    Example
    : Class z extends A,B --- Inavallid (bcz direct way)

    Class B extends A
    } ---- those are vallid (bcz indirect way)
    Class Z extends B

    So, here Class z can have all the features of Class B and Class A, but here we are doing indirect way with the help of Single Inheritance.
     

Share This Page