---
title: "What are the four pillars of OOP?"  
description: "What are the four pillars of OOP?"  
author: "Steilla Mitchel"  
published: 2023-06-21  
updated: 2023-06-25  
canonical: https://www.mindstick.com/forum/158812/what-are-the-four-pillars-of-oop  
category: "oops"  
tags: ["c#", "java", "oops"]  
reading_time: 2 minutes  

---

# What are the four pillars of OOP?

What are the four pillars of [OOP](https://www.mindstick.com/forum/160066/what-is-oop-in-javascript)?

## Replies

### Reply by Aryan Kumar

The four pillars of object-oriented programming (OOP) are abstraction, encapsulation, inheritance, and polymorphism.

- **Abstraction** is the process of hiding implementation details from the user. This means that the user only sees the essential behavior of the object, without having to worry about how it is implemented. For example, a user of a Circle object only needs to know that they can draw the circle and calculate its area. They do not need to know how the circle is implemented, such as the fact that it is made up of a set of points.
- **Encapsulation** is the process of grouping data and methods together into a single unit. This means that the data and methods are protected from outside access. For example, the Circle object might have a property called radius. This property is encapsulated, which means that the user cannot directly access it. Instead, they must use the getRadius() and setRadius() methods to access the property.
- **Inheritance** is a mechanism in OOP that allows a new class to inherit the properties and methods of an existing class. This means that the new class can use the code that is already written in the existing class, without having to reimplement it. This can save time and effort, and it can also help to ensure that the code is implemented consistently.
- **Polymorphism** is the ability of an object to take on different forms or behave in different ways depending on the context in which it is used. In OOP, polymorphism is achieved through the use of inheritance, interfaces, and method overloading.

These four pillars are the foundation of object-oriented programming. They provide a way to organize code in a way that is both efficient and maintainable. By using these pillars, programmers can create code that is easier to understand, reuse, and extend.


---

Original Source: https://www.mindstick.com/forum/158812/what-are-the-four-pillars-of-oop

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
