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

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

Explain why java doesn't support multiple inheritance.

Posted By :Ghanashyam Nayak     Posted Date :September 28, 2010    Points :10   Category :JavaScript/VBScript 
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.

You can also find related Interview Question to Explain why java doesn''t support multiple inheritance.  below: 

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 (More...)

Does Csharp support multiple inheritance?

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

Can you explain what inheritance is and an example of when you might use it?

Inheritance is a fundamental feature of an object oriented system and it is simply the ability to inherit data and functionality from a parent object. Rather than developing new objects from scratch, new code can be based on the work of other programmers, adding only new features that are needed. (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 ....


Explain the ways to serialize the java object.

Object serialization could be used in different ways:

- Simple persistence of the object
- Reading from and writing to files
- RMI technology for communicating across hosts.

The encryption and decryption is left to the network transport. SSL or the like can be used when a secured channel is needed. (More...)

Explain how to convert java file to jar files.

The following is the process:

- Type jar -cvf <.java file(s)>
where c stands for create, v stands for verbose and f indicates the file follows it, into which the archive to be stored. <.java file(s)> is the java files that are to be placed in the .jar file. (More...)

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. (More...)

How is .NET able to support multiple languages?

a language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language. (More...)

does multiple inheritance possible in c#

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

Can code inside multiple catch block be executed?

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

What programming languages will the .NET Framework support?

The .NET Framework is language neutral; virtually any language can target the .NET Framework. Currently, you can build .NET programs in a number of languages, including C++, Microsoft® Visual Basic.NET, _JScript®, and Microsoft's newest language-C#. A large number of third-party languages will also be available for building .NET Framework applications. These languages include COBOL, Eiffel, Perl, Python, Smalltalk, and others. (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