DEV Community

Mohamed Ajmal
Mohamed Ajmal

Posted on

OOPS Concepts in Java.

Object-Oriented Programming (OOPS) is a paradigm that organize the code using Classes and objects.

The seven core concepts of Object-Oriented Programming (OOPS) include the four main pillars—Encapsulation, Abstraction, Inheritance, and Polymorphism—along with Classes, Objects, and Association. These concepts allow for modular, reusable, and secure code by organizing software around data rather than functions.

1.Class - Class is the Blueprint or Templates that defines data member (Attributes) and member functions (Behaviors).

2.Object - An instance of a class. It is a real-world entity that holds data and has a specific state and behavior.

3.Encapsulation- Wrapping data (variables) and code (methods) together as a single unit, hiding the internal state from the outside world to protect integrity.

4.Abstraction- Representing essential features while hiding unnecessary background details, simplifying complex systems.

5.Inheritance- The mechanism by which one class (subclass/child) acquires the properties and behaviors of another class (super class/parent), promoting code re-usability.

6.Polymorphism- The ability of an entity (method or object) to take on many forms, allowing one interface to be used for a general class of actions.

Top comments (0)