adspace


Does Java support multiple Inheritance?

Answer Posted / ramakrishna

JAVA omits many rarely used, poorly understood,
confusing features of C++ that in our experience bring more
grief than benefit. This primarily consists of operator
overloading (although it does have method overloading),
multiple inheritance, and extensive automatic coercions.

Who better than Dr. James Gosling is qualified to make a
comment on this. This paragraph gives us an overview and he
touches this topic of not supporting multiple-inheritance.
Java does not support multiple inheritance

First lets nail this point. This itself is a point of
discussion, whether java supports multiple inheritance or
not. Some say, it supports using interface. No. There is no
support for multiple inheritance in java. If you do not
believe my words, read the above paragraph again and those
are words of the father of Java.

This story of supporting multiple inheritance using
interface is what we developers cooked up. Interface gives
flexibility than concrete classes and we have option to
implement multiple interface using single class. This is by
agreement we are adhering to two blueprints to create a class.

This is trying to get closer to multiple inheritance. What
we do is implement multiple interface, here we are not
extending (inheriting) anything. The implementing class is
the one that is going to add the properties and behavior. It
is not getting the implementation free from the parent
classes. I would simply say, there is no support for
multiple inheritance in java.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a classloader in java?

1096


explain different ways of using thread? : Java thread

1089


How to sort array in descending order in java?

999


What is java string pool?

1088


Differentiate between static and non-static methods in java.

1131


What is parsing in java?

1046


What is a constructor overloading in java?

1131


Is minecraft 1.15 out?

1050


Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example

2672


Realized?

2272


How to create a base64 decoder in java8?

1144


What do you mean by an interface in java?

1107


Write a program to print count of empty strings in java 8?

1092


What is an object in java and how is it created?

1147


What is the difference between equals() and == in java?

1047