I've been doing some studying on the types of inheritance. From what I've learned:
- Single inheritance refers to when a class inherits another class.
- Multi-level inheritance refers to when a class inherits another class that inherits another class, etc.
- Hierarchical inheritances refers to when a super-class that has many sub-classes.
Say you wanted to have
B inherit from
A. In Java, all classes are ultimately inherited from the
Object class. Therefore,
A -> B becomes
Object -> A -> B.
Object has many sub classes, is it safe to say that
A -> B is single or hierarchical inheritance? Can you have "true" single inheritance in Java?