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, 2022 in Java by Soham
• 9,700 points
587 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, 2022 by Rahul
• 9,670 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, 2022 in Java by Rahul
• 3,380 points
263 views
0 votes
1 answer

Why multiple inheritance is not supported in Java?

The absence of multiple inheritance in the ...READ MORE

answered Oct 17, 2023 in Java by anonymous
• 3,320 points
359 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,807 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,924 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, 2022 in C# by pranav
• 2,590 points
221 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,090 points
760 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
505 views
0 votes
0 answers

Is hiding implementation detail Encapsulation or Abstraction?

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

May 6, 2022 in Java by narikkadan
• 63,700 points
2,573 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, 2022 in Java by Rahul
• 9,670 points

edited Jul 6, 2023 by Khan Sarfaraz 566 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP