O'Reilly logo

Sams Teach Yourself Object Oriented Programming in 21 Days, Second Edition by Anthony Sintes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Inheritance: Getting Something for Nothing

For the past three days, you’ve concentrated on learning about the first pillar of object-oriented programming: encapsulation. Although encapsulation is a fundamental concept in OOP, there is more to the story than supporting simple ADTs and modules. In fact, OOP would offer very little over older-style programming if all it did was offer simple encapsulation. Of course, OOP offers much more.

OOP goes further by adding two other features: inheritance and polymorphism. You will spend the next two days considering inheritance, the second pillar of OOP.

Today you will learn

  • What inheritance is

  • The different types of inheritance

  • Some of the pitfalls of inheritance

  • Tips to effective inheritance

  • How inheritance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required