Object-Oriented Programming (OOP) and Inheritance

Click MIT6_096IAP11_lec07.pdf link to view the file.

Classes are what separate the capabilities of C from that of C++. Classes are the object-oriented aspect of programming.

To think about classes, consider writing utensils. A pen, a pencil, and a marker are all writing utensils. However, when a pen uses ink; a pencil uses graphite, and so forth. The color of the pencil or the pen might be different, but their shapes and behaviors are the same. This is what object-oriented programming is about. We can define the characteristics of a writing utensil and then create specific instances of each object based on the unique characteristics of each instance of the object, without having to define their common characteristics each time.