Multiple Inheritance
-
if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal
-
if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal
-
But C++ is doing it all well panal
-
But C++ is doing it all well panal
consider a situation where classA which has a function f() classB and classC are childs of classA. hence they both have the same copy of f(). now consider classD inherits both classB and classC (multiple inheritance) in which case there will be a ambiguity as to which copy of f() is called since both of them have the same. inorder to avoid this complexity c# provides a multiple inheritance of interfaces and not classes since u give the definitions of the functions in the class which implements them sathy
-
But C++ is doing it all well panal
Well, there aren't that many languages that support complete OO design. Even Java and C# aren't completely OO although they're called OO languages, as is C++. C# is just more OO then C++. Maybe it's clearer in other words: In C++ we have more ways for no OO design. (eg. multiple inheritance, ...) Coulda, woulda, shoulda doesn't matter if you don't.
-
if any body tell me the core idea then its very thankfull question is why c# not support multiple inheritance with class Thanks in adv panal
In addition to the replies you already got, the clean way is supported by C#: your class can implement several interfaces. Regards, mav -- Black holes are the places where god divided by 0...