why java does not support multiple inheritance

Answer Posted / priyanka patil

The reasons for omitting multiple inheritance from the Java
language mostly stem from the "simple, object oriented, and
familiar" goal. As a simple language, Java's creators
wanted a language that most developers could grasp without
extensive training. To that end, they worked to make the
language as similar to C++ as possible (familiar) without
carrying over C++'s unnecessary complexity (simple).

In the designers' opinion, multiple inheritance causes more
problems and confusion than it solves. So they cut multiple
inheritance from the language (just as they cut operator
overloading). The designers' extensive C++ experience
taught them that multiple inheritance just wasn't worth the
headache.

Instead, Java's designers chose to allow multiple interface
inheritance through the use of interfaces, an idea borrowed
from Objective C's protocols. Multiple interface
inheritance allows an object to inherit many different
method signatures with the caveat that the inheriting
object must implement those inherited methods. Multiple
interface inheritance still allows an object to inherit
methods and to behave polymorphically on those methods. The
inheriting object just doesn't get an implementation free
ride

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a finally block? Is there a case when finally will not execute?

754


What does g mean in regex?

750


Explain the difference between extends thread vs implements runnable in java?

812


How can you say java is object oriented?

825


How do you check if a string contains only numeric digits?

873


What mechanism does java use for memory management?

720


What is java basic concept?

789


How do you define a variable?

733


Differences between external iteration and internal iteration?

859


What is an anonymous class in java?

782


Explain java code for recursive solution's base case?

784


What class allows you to read objects directly from a stream?

1113


Why do we need strings in java?

709


What is the mapping mechanism used by java to identify IDL language?

804


How many types of literals are there in JAVA?

788