why .net does not support multiple inheritance?

Answers were Sorted based on User's Feedback



why .net does not support multiple inheritance?..

Answer / satish kumar k

In object-oriented programming languages with multiple
inheritance and knowledge organization, the diamond problem
is an ambiguity that arises when two classes B and C inherit
from A, and class D inherits from both B and C. If a method
in D calls a method defined in A (and does not override the
method), and B and C have overridden that method
differently, then from which class does it inherit: B, or C?
For example, in the context of GUI software development, a
class Button may inherit from both classes Rectangle (for
appearance) and MouseEvent (for functionality), and classes
Rectangle and MouseEvent both inherit from the Object class.
Now if the equals method is called for a Button object and
there is no such method in the Button class but there is an
over-ridden equals method in both Rectangle and MouseEvent,
which method should be eventually called?

Is This Answer Correct ?    7 Yes 1 No

why .net does not support multiple inheritance?..

Answer / satish kumar k

Languages that only allow single inheritance (such as Ada,
Objective-C, PHP, C#, Delphi/Free Pascal and Java) allow the
multiple inheritance of interfaces (called protocols in
Objective-C). Interfaces are essentially abstract base
classes with all abstract methods and no data members. The
problem is therefore avoided since there is always only one
implementation of a specific method or property and no
ambiguity arises

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

Dynamic Fonts

0 Answers  


What is the procedure to add assemly to gac to make it shared one?

0 Answers  


What is the use of trace utility?

1 Answers  


What is the Difference between directcast and ctype?

3 Answers   Wipro,


What is RCW (Run time Callable Wrappers)?

0 Answers  






How server form post-back works?

0 Answers  


What is clr in .net?

0 Answers  


Is it true that objects don't always get destroyed immediately when the last reference goes away?

0 Answers  


Tell me what is a “jagged array”?

0 Answers  


What is meant by globalization and localization?

0 Answers  


What is the use of activex control in .net?

0 Answers  


With these events, why wouldn't microsoft combine invalidate and paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?

0 Answers  


Categories