Why is there no multiple inheritance in Java but implementing multiple interfaces is allowed

0 votes
I have observed that Java does not allow multiple inheritance, but it allows implementing multiple interfaces. Why is that?
Feb 10 in Java by Soham
• 8,730 points
34 views

1 answer to this question.

0 votes
To answer your doubt, the reason is due to the limited specifications of the interface which only lays emphasis on what the class is doing but does not lay any emphasis on how the class is doing it. Two classes might define different ways of doing the same task for which the subclass cannot choose which one to pick and this is one of the cons of the multiple inheritance.
answered Feb 10 by Rahul
• 8,980 points

Related Questions In Java

0 votes
0 answers

Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?

Java doesn't allow multiple inheritance, but it ...READ MORE

Apr 26 in Java by Rahul
• 3,380 points
39 views
0 votes
1 answer

Why there is the need of getters and setters in java

In Java getters and setters are completely ...READ MORE

answered Jun 26, 2018 in Java by scarlett
• 1,290 points
1,364 views
0 votes
1 answer

Why the main() method in Java is always static?

As you might know, static here is ...READ MORE

answered May 9, 2018 in Java by geek.erkami
• 2,680 points
1,218 views
0 votes
2 answers

Is there a destructor in Java?

try (BufferedReader br = new BufferedReader(new FileReader(path))) ...READ MORE

answered Sep 4, 2018 in Java by Sushmita
• 6,900 points
471 views
0 votes
0 answers

When to use an interface instead of an abstract class and vice versa

This could be an OOP question in ...READ MORE

Jun 11 in C# by pranav
• 2,580 points
4 views
0 votes
1 answer

How is inheritance in C++ different than that in Java?

The purpose of inheritance is same for ...READ MORE

answered Feb 6, 2019 in Java by Priyaj
• 58,080 points
309 views
0 votes
1 answer

What is Comparable in Java?

As the name itself suggests, Comparable is an interface which defines ...READ MORE

answered Jul 15, 2019 in Java by Neha
• 6,300 points
240 views
0 votes
0 answers

Is hiding implementation detail Encapsulation or Abstraction?

I have seen some people defining abstraction ...READ MORE

May 6 in Java by narikkadan
• 10,840 points
62 views
0 votes
1 answer
0 votes
1 answer

How to split a string in Java

By using the appropriate method, this can ...READ MORE

answered Feb 9 in Java by Rahul
• 8,980 points
37 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP