Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a class, extending another class, extends Object class though multiple inheritance is not allowed?

Since I am new to java. I want to know if multiple ineritance is not supported in java then how a class extends another class alongwith the default superclass Object?

like image 592
Anshul Avatar asked Dec 28 '22 16:12

Anshul


1 Answers

Because although multiple inheritance isn't allowed, one class can inherit from another which can inherit from another - and eventually the class at the top of that chain will inherit from object (it'll do that if you don't specify any specific class for it to inherit from.)

like image 105
Michael Berry Avatar answered Jan 26 '23 00:01

Michael Berry