No Java does not support the multiple inheritance -
Reason of the diamond issue arises because of multiple inheritance, consider the following example
// A Grand parent class
class GrandParent
{
void fun()
{
System.out.println("Grandparent");
}
}
// First Parent class
class Parent1 extends GrandParent
{
void fun()
{
System.out.println("Parent1");
}
}
// Second Parent Class
class Parent2 extends GrandParent
{
void fun()
{
System.out.println("Parent2");
}
}
// Error : Test is inheriting from multiple classes
class Test extends Parent1, Parent2
{
public static void main(String args[])
{
Test t = new Test();
t.fun();
}
}
On calling the method t.fun() will cause complications such as whether to call Parent1’s fun() or Beta’s fun() method. Therefore, in order to avoid such complications Java does not support multiple inheritance of classes.