Is java.lang.Object
superclass of all the custom class/objects inherited implicitly? I thought java didn\'t support multiple inheritance. The reason I ask is i
The custom class that you inherit from itself inherits directly or implicitly from Object
, so you indirectly inherit from Object. The chain goes YourObject -> MiddleObject -> java.lang.Object
. No multiple inheritance necessary.
Multiple inheritance is when you directly inherit from two unrelated classes. For example, if you have a class PoliceDog
that inherits directly from both Canine
and PoliceOfficer
, that would be multiple inheritence.