Inheritance, Polymorphism, and Encapsulation
Inheritance, polymorphism, and encapsulation comprise the three central characteristics of object-oriented (OO) programming. Inheritance allows you to create class hierarchies, where a base class gives its behavior and attributes to a derived class. You are then free to modify or extend its functionality. Polymorphism ensures that the proper method will be executed based on the calling object’s type. Encapsulation allows you to control access to your object’s state, while making it easier to maintain or change your implementation at a later date.
Unable to display preview. Download preview PDF.