Object orientated programming, or OOP is one the most popular modern programming paradigms. OOP is used today in programming languages like Java, Python, C++ and JavaScript to create code that is simple to write and understand.

Since its inception in the late 1960s, it has been nearly impossible to find a programming language that hasn’t been influenced by OOP.

What is an object anyway?

An object can be simply thought of as anything with properties and or behaviors. For a more illustrative example, we can look at basketballs.

Basketballs have many properties, like their size, number of bounces, color, and location. They also have behaviors, like bounce, inflate and deflate. This is a good candidate for an object, since it is a “thing” that has properties that can be different.

Objects vs Classes

One common mistake that many first-time programmers make is not understanding the difference between an object and class. While somewhat similar, it is very important that a programmer understands the difference.

A class is a template for an object, and thus, an object is an instance of a class. In other words, a class is like a blueprint for a building while an object is the building itself.

Classes, not Objects

I was being slightly misleading when describing what an object is at the beginning of this tutorial. When writing code in an OO (object orientated) language, you’re writing code that describes a class, not an object.

The idea behind object orientated programming is that you are to create instances of classes that all have different property values, but have the same ways of interfacing.

The end result of this paradigm is generally less code written than other programming paradigms because it inherently increases code reuse.

Next Step

After learning about the ideas behind OOP, you can learn about how to actually code OOP in Java with my tutorial on Object Orientated Programming in Java.