Inheritance
So far, we've learned the basics of objects and classes, as well as their class methods and variables, and instance methods and variables. We've learned that classes are templates for objects, and that we can create classes to represent data and behavior that can be grouped together in order to model a higher-level concept such as a user. This allows us to keep our code clean, organized, and extensible.
Just as we've learned that classes are templates for objects, we can go one step further by learning how to use classes as templates for other classes. This is particularly useful for when you want to have several classes that all share common data and behaviors. Conceptually, think of these "subclasses" as types of a class. A common example of this is vehicles. Vehicles share characteristics, for example, they travel at a certain speed, in a certain direction, and perhaps have a number of wheels. A car generally has four wheels, a bicycle has...