This unit covers object-oriented programming concepts of inheritance and polymorphism. It explores superclasses and subclasses, creating subclasses using the extends
keyword, and the super
keyword for constructors and methods. Method overriding, dynamic and static typing, and the Object superclass are also discussed. Finally, the unit introduces inheritance hierarchies and the concept of polymorphism.
Give us your feedback and let us know how we can improve
Question 1 of 10
In the context of inheritance, if 'Animal' is a general class, and 'Dog' and 'Cat' are more specific classes, which of the following is true? 🐕
Animal is the subclass, and Dog and Cat are the superclasses
Animal is the superclass, and Dog and Cat are subclasses
All three are superclasses
All three are subclasses