c++ inheritance vs java interitance
807606Feb 9 2007 — edited Feb 9 2007C++ used mutiple ineritance.......
the problem was there ...
1.probability of clashes in methods (if were same)of base classes...
2. diamond problem:if base classes were derived from the same class..then there would be copy of root in grant child
so.........
java takes the inheritance from C++
but it does not allow multiple inheritance
although mutiple inhertince allows combination of more abstraction,it had to follow the previous two problems.......
So.java allows multilevel but not multiple inheritance........
But java allows mutiple interface.......to gain the benefit .....
but as the interface are not making diamond problems or clash said before...because any derived interfaces or base interface..does not contain the fuction body,so no clash or diamond problem is possible here...................