Classifying What You’ve Learned
In this chapter, you learned the following:
-
In object-oriented languages, new types are defined by creating classes. Classes support encapsulation; in other words, they combine data and the operations on it so that other parts of the program can ignore implementation details.
-
Classes also support polymorphism. If two classes have methods that work the same way, instances of those classes can replace one another without the rest of the program being affected. This enables “plug-and-play” programming, in which one piece of code can perform different operations depending on the objects it is operating on.
-
Finally, new classes can be defined by inheriting features from existing ones. The new class can override ...
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