16 Inheritance: What a Legacy
One of the most distinctive features of classes is subclassing, in which one class inherits the members of a previously defined class. This feature is important for several reasons.
The first reason is that subclassing lets you customize existing software. You can take a class someone else has created and add new features of your own. You can also overwrite any and all existing features of the class. Classes are therefore extensible and reusable (and that’s the last you’ll see of annoying buzzwords in this chapter, I promise).
This sounds wonderful… and sometimes it really is, but (for technical reasons I’ll cover in this chapter) things are not always that easy. For one thing, you have to revise all the constructors ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access