Creating Superclasses and Subclasses

Caleb Thomas
4 min read
Listen to this study note
Study Guide Overview
This study guide covers inheritance and polymorphism in object-oriented programming. It focuses on subclasses inheriting methods and instance variables from superclasses. The guide also explains the diamond problem and how to create subclasses in Java using the extends
keyword.
#Introduction to Inheritance
In this unit, we will mainly focus on the last two principles of object-orientated programming. In the first half of the unit, we will discuss inheritance, while in the second half, we will discuss polymorphism.
Inheritance is where one class, called the subclass, can share methods and instance variables with another class called the superclass. When we make a subclass, the subclass can use all of the methods and instance variables of the superclass with the exact same implementation without having to write these again. However, we wi...

How are we doing?
Give us your feedback and let us know how we can improve