can you do inheritance with more than five classes?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 7, 2014, 4:27 PM
The most obvious one is a Person class which inherits from both a Mother and a Father class.
Check out this link which has some class diagrams for multiple inheritance in C++ including one for the 'diamond' problem where a class inherits from two classes which each inherit from a single base class:
http://www.learncpp.com/cpp-tutorial/117-multiple-inheritance/
Mongezi SitholePosted Mar 7, 2014, 8:30 AM
Mongezi SitholePosted Mar 7, 2014, 8:30 AM
Lindokuhle DlaminiPosted Mar 7, 2014, 6:43 AM
VulpesPosted Mar 7, 2014, 6:24 AM
Yes, there are languages which support multiple inheritance despite the ambiguities which this entails.
They include well known languages such as C++, Eiffel, Perl and Python.
Mhlengi NtshangasePosted Mar 7, 2014, 3:50 AM
Lindoh MthiyaPosted Mar 7, 2014, 3:42 AM
yes as long as they after not sealed
Mongezi SitholePosted Mar 7, 2014, 2:57 AM
VulpesPosted Mar 6, 2014, 6:21 AM
C# doesn't support multiple inheritance where a class can have two or more parent classes.