In the Java programming language, can a class inherit its methods from several other classes at the same time? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 21

In the Java programming language, can a class inherit its methods from several other classes at the same time?

20th May 2020, 9:03 PM
sasan zare
sasan zare - avatar
2 Answers
+ 7
Multiple inheritance of classes is not allowed in Java so this is not at all a possibility. You can do the same with the help of interfaces but you must give an implementation to all the overridden methods because interface methods are by default abstract.
20th May 2020, 9:16 PM
Avinesh
Avinesh - avatar
+ 5
No, you have to use interfaces.
21st May 2020, 12:12 AM
Sonic
Sonic - avatar