Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
Tell me one reason for dotnet doesn't have multiple inheritance
Posted By :
Posted Date :
March 15, 2010
To avoid ambiguity and deadlocks
You can also find related Interview Question to
Tell me one reason for dotnet doesn''t have multiple inheritance
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.
Does C# support multiple inheritance?
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
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.
derivedClass is derived from baseClass.
Interface Inheritance example:
private Class derivedClass:baseClass , InterfaceX , InterfaceY ....
Can we implement Multiple Inheritance by using Abstract Class?
As the abstarct class can contain simple methods also, therefore it doesn't support Multiple Inheritance in DotNet.
does multiple inheritance possible in c#
through interfcae we can do multiple inheritance
Does C# support multiple inheritance?
no , use interface
Does Csharp support multiple inheritance?
C sharp doenst support multiple inheritance, but can be achived using interface
Can code inside multiple catch block be executed?
No, Code can not execute in mutiple catch block
Which levels of the index can have multiple pages?
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.
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.
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.
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.
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.
Quick Links For Interview Questions Categories:
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
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
Terms of Service
Tell A Friend