91.0k views
2 votes
Which technique/concept can be use toimplement multiple inheritances
in java?

User Cripto
by
6.6k points

1 Answer

4 votes

Answer:

Interface

Step-by-step explanation:

Java does not supports multiple inheritance by class, but we can implement multiple inharitacnce in java using interface, with interface we uses implements keyword.

Example-

Declare interface like below code -

interface parent{

}

and use in child class like below code -

class Child1 implements interface{

}

class Child2 implements interface{

}

User PopeJohnPaulII
by
6.4k points