+ 3
Why c# has only one base class for a child class ?
6 Respuestas
+ 3
Multiple inheritance makes code more complex and vulnerable for bugs. It is often used wrong and sometimes used right.
So
according to Codeproject.com
quote:
They don't have multiple inheritance because their designers had to choose between have it in and have all the problems it comes with, or get it out of the language putting away all those problems, and introduce a versatile and less problematic substitute like interfaces and interface inheritance.
https://www.codeproject.com/Articles/10072/Simulated-Multiple-Inheritance-Pattern-for-C
End quote;
Used I base class and multiple interface.
Note it is allowed to do hierachical inheritance
+ 3
Search Diamond Problem that was caused due to multiple inheritance in c++, so c# developers decided to make the language not to allow a class to be inherited from more than one classes.
0
Can you explain your question a bit more ?
Do you have a code example ?
0
Class x : baseclasshere {
}
0
What would you like it to be ?
0
Like having multiple base class