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

What is serialization in .NET? What are the ways to control serialization?

1 Answers  


What exactly is being serialized when you perform serialization in .net?

0 Answers  


What is operator overloading in .net?

0 Answers  


What are the improvements made in cas in .net 4.0?

0 Answers  


What is CCW (COM Callable Wrapper)

1 Answers  






The project which you have made, which methodology did you use?

0 Answers   Wipro,


for the textbox if i want to allow only numbers.what ever the characters u enter it should not take.which event u used?

5 Answers   IBM,


What are pdbs?

0 Answers  


What is the advantage of .net core?

0 Answers  


How to load a user control dynamically in runtime?

0 Answers  


Define marshling?

0 Answers  


How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?

0 Answers  


Categories