What Is OOP?

Object-oriented programming (OOP) is a tool for organizing your programs into reusable objects. It won't necessarily make you program better or faster, yet it's one of the best ideas in programming to come along so far. A common myth about object-oriented programming is that it's hard to learn and that you should learn a non-OOP language first, but you don't have to do this. In fact, OOP is easy to learn because it models the real world. Bottom line? Don't fear object-oriented programming.

Here are the triple pillars of OOP:

  • Polymorphism

  • Encapsulation

  • Inheritance

Of the three, polymorphism is the most important because it supports the replaceable nature of objects.

Objects as Black Boxes (Encapsulation)

Say you're driving along and ...

Get Python Programming with the Java™ Class Libraries: A Tutorial for Building Web and Enterprise Applications with Jython now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.