Object Oriented Programming

Eliza Munroe
1 min readAug 9, 2021

Today I wanted to write about the fundamentals of Object Oriented Programming. I’ve been chatting with software engineers working in the field and this topic comes up during interviews a lot.

The four main pillars of OOP are Encapsulation, Abstraction, Inheritance and Polymorphism.

The first pillar, Encapsulation, means that each object inside a class has a private state. Other objects are not able to directly access this state. Other objects can use public functions rather than directly accessing that state.

Abstraction, the second pillar, involves pulling only relevant details from data. This pillar makes use of simplified and high level methods to gain access to a complex object. Abstraction represents complicated objects with simple things. This is helpful as is allows the user to focus on high level functioning and not have to focus on complex details.

Inheritance is a pillar of OOP that lets classes inherit attributes and behaviors. Parent classes are able to pass attributes and behaviors down to child classes. Inheritance is imports because it allows for reusability.

Polymorphism allows objects to be created to share behaviors. With Polymorphism, objects use specific child behaviors to override shared parent behaviors. This pillar lets a method perform different behaviors in two different ways, which are method overriding and method overloading.

This blog entry just scratches the surface of the four pillars of OOP. I’ll be delving into this topic with further detail in the future.

--

--