What is different between multiple inheritance vs interface? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is different between multiple inheritance vs interface?

12th Mar 2016, 10:33 AM
Zayed Rais
Zayed Rais - avatar
2 Answers
+ 2
Java doesn't support multiple inheritence so when you implement an interface in a class , you are not actually inheriting anything(data members,etc.) but just some method declarations and you have to write the definitions by yourself.
13th Jul 2016, 1:23 PM
Shubham Saraswat
Shubham Saraswat - avatar
+ 1
A class can inherit from just one superclass, but can implement multiple interfaces in Java. So, you basically use interfaces to implement multiple inheritance.
18th May 2016, 3:47 PM
James Flanders