The designers of Java avoided multiplhe inheritance. Replacing it is multiple conformance to interfaces. In Java, there is a structure called an “Interface”. A Java interface is almost identical to a C++ class that has nothing but pure virtual functions. In Java you cannot inherit from more than one base class. However you can “implement” more than one interface.
This UML diagram shows four classes arranged in the diamond structure that creates the need for virtual inheritance. Both of the classes B and C inherit from class A. D multiply inherits from both B and C. Two problem arise from this. First, which implementation of the ’f’ function does D inherit? Should it inherit B::f() or C::f(). In C++ the answer turns out to be neither. D::f() must be declared and implemented. This eliminates the ambiguity, and certainly this simple rule could have been adopted in Java.