Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

c++ inheritance vs java interitance

807606Feb 9 2007 — edited Feb 9 2007
C++ 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...................
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2007
Added on Feb 9 2007
10 comments
290 views