Senator Guerra Souty original series calendar,replica hublot blue steel peach pointer collocation of rolex replica Rome digital scale, track type minute replica watches scale shows that the classical model is swiss replica watches incomparable, wearing elegant dress highlights.


YOU ARE HERE: HOME Questions Why net do not support multiple inheritance

Multiple inheritance in .NET

View(s): 26188

Why .net do not support multiple inheritance?

Answer 1)

The reason is multiple inheritance arise Diamond Problem.

The languages like C++, support multiple inheritance as this language address the diamond problem using virtual inheritance.

But .NET was designed to support multiple languages, but not all languages can effectively support multiple inheritance. 

If .NET needs to support multiple inheritance, then

  1. All languages supported by .NET should support multiple inheritance, which will add the complexity in language semantics (complex syntax and keywords).
  2. Newly introduced make some of these languages more difficult to use because of less similar to their previous version and will not have backward compatibility.
  3. Different languages actually have different expectations for how multiple inheritance works and few languages do not want this concept at all. And expressing them in a language-neutral manner is one more big challenge.
  4. Apart from diamond problem, multiple inheritance injects a lot of complexity in implementing casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.

Above factors influenced the .NET team to favor not implementing multiple inheritance.

  Asked in:  TCS (Tata Consultancy Services)   Expertise Level:  Experienced
  Last updated on Sunday, 25 March 2012
3/5 stars (17 vote(s))

Register Login Ask Us Write to Us Help