.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Tell me one reason for dotnet doesn't have multiple inheritance

Posted By :nishithraj     Posted Date :March 15, 2010    Points :10   Category :.NET Framework 
To avoid ambiguity and deadlocks

You can also find related Interview Question to Tell me one reason for dotnet doesn''t have multiple inheritance  below: 

Explain why java doesn't support multiple inheritance.

  
Java does not support multiple inheritances. To avoid ambiguity problem - Diamonds of Death - and complexity of multiple inheritance.

The Diamond of Death is a problem without clarity. The Diamond problem is:

Two classes Two and Three inherit from class One. Class Four inherits from both Two and Three. When a method in Four invokes a method that is defined in One, and Two and Three have overridden that method in different way, the ambiguity and complexity occurs - through which class does it inherits: class Two or class Three?

Like wise if it is encouraged to have more than two classes to inherit, the ambiguity raises which leads to future conflict of applications. (More...)

Does C# support multiple inheritance?

  
No

C# does not support multiple inheritance. A class can inherit from maximum one base class, although it can implement any number of interfaces. Like Java, C# does not support multiple inheritance, meaning that classes cannot inherit from more than one class (More...)

can we impliment multiple inheritance by using interfaces in C#.net?

  
yes we can implement:

Inheritance Usage Example:
Here is a syntax example for using Implementation Inheritance.


Class derivedClass:baseClass
{
}

derivedClass is derived from baseClass.

Interface Inheritance example:
private Class derivedClass:baseClass , InterfaceX , InterfaceY ....
{
}

(More...)

Can we implement Multiple Inheritance by using Abstract Class?

  
No.
As the abstarct class can contain simple methods also, therefore it doesn't support Multiple Inheritance in DotNet. (More...)

does multiple inheritance possible in c#

  
through interfcae we can do multiple inheritance (More...)

Does Csharp support multiple inheritance?

  
C sharp doenst support multiple inheritance, but can be achived using interface (More...)

Can code inside multiple catch block be executed?

  
No, Code can not execute in mutiple catch block (More...)

What is difference between interface inheritance and class inheritance?

  
We can only inherit from one class but multiple interfaces. In addition, an interface does not contain any implementation it just contains a series of signatures. (More...)

What is garbage collection in dotnet?

  
Garbage collection is a mechanism that allows the computer to detect when an object can no longer be accessed. It then automatically releases the memory used by that object (as well as calling a clean-up routine, called a "finalizer," which is written by the user). Some garbage collectors, like the one used by .NET, compact memory and therefore decrease your program's working set. (More...)

Can we have multiple threads in one App domain ?

  
One or more threads run in an AppDomain. An AppDomain is a runtime representation of a logical process within a physical process. Each AppDomain is started with a single thread, but can create additional threads from any of its threads.
Note :- All threading classes are defined in System.Threading namespace. (More...)

How many types of JIT compilers in dotnet?

  
There are mainly three types of JIT Compilers. Pre-JIT:-Pre-JIT complies complete source code into native code in a single compilation cycle.Its hapeen at the time of deployment. Econo-JIT:-Econo-JIT compiles only those methods which is called at runtime and these methods are removed when these are not required. Normal-JIT:- Compiles method that are called on runtime.These methods are called first time they are compiled and then stored in cache. (More...)

Is it possible to add multiple Machine.config file?

  
No, it is not possible to add more than 1 machine.config file. if we want to overwrite any setting than that can be achieve with the help of web.config. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend