+ 3
Does java really support multiple inheritance ?
Its very well known that java does not support class based multiple inheritance but using interface that can be achieved. But main advantage of inheritance is re usability and in case of multiple inheritance based on inheritance the concrete class which will implement the child interface will have to give the implementation of all the methods defined in parents interface. So we are not able to to achieve what inheritance is there for. So does java really support multiple inheritance.
4 Answers
+ 2
Java doesn't support multiple inheritance it only support single inheritance. You can use aggregation with Java it works like multiple inheritance.
+ 1
There is no support for multiple inheritance in java.
The problem with multiple inheritance is that two classes may define different ways of doing the same thing, and the subclass can't choose which one to pick.
That's why Interface comes in picture.
For more details please refer http://javapapers.com/core-java/why-multiple-inheritance-is-not-supported-in-java/
0
@Sarafaraz: I too know all this but my question is some thing different. please read carefully and then only answer
- 1
Using Interface we can achieve multiple inheritable. An interface can implement another interface and a class can implement as many interface as required.
Here is the example. The class "Test" is implementing both interface Printable and Showable.
interface Printable
{Â Â
void print();Â
 }Â
 interface Showable
{Â
 void show();Â
 } Â
class Test  implements Printable,Showable
{Â Â
public void print()
{
System.out.println("Hello");
}
public void show()
{
System.out.println("Welcome");
}Â Â Â Â
public static void main(String args[])
{Â
 Test obj = new Test(); Â
obj.print();Â Â
obj.show();Â Â Â
}Â Â
}
Output will be:
Hello
Welcome