Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   C++ multi-inheritance (http://www.go4expert.com/forums/cpp-multi-inheritance-t6572/)

vql 27Sep2007 21:26

C++ multi-inheritance
 
It said that C++ have disadvantages like as multi-inheritance. Because modern languages (C#, Java) don't use multi-inheritance, and they replace with the keyword interface. Anyone tell me why C++ have disadvantage about multi-inheritance, and try give me an example. Thanks.

Final, please tell me other disadvantages of C++. Thanks a lot.

vql 30Sep2007 20:35

Re: C++ multi-inheritance
 
Anyone can help me? I am learning C++. Thanks.

DaWei 30Sep2007 21:43

Re: C++ multi-inheritance
 
The advantage of multiple inheritance is that you can inherit functionality from more than one object. Obviously, it would be bad if both objects had a member with the same name. It can also lead to unwarranted complexity. An interface is not multiple inheritance. C# and Java use virtual machines. Thus, their efficiency is reduced.

For questions like this, you should either study the materials that have been provided to you, or resort to Google. The answers are not simple or cast in concrete. You might have a look here.


All times are GMT +5.5. The time now is 21:20.