The concept of object-oriented programming was seen to solve many problems, which procedural programming did not solve. In object-oriented programming, everything mimics just like a real-world object. In the real world, everything is an object. An object can have state and behavior. An object in the real world can communicate with another object. For example, a dog object in the real world has state and behavior. OOPs is based on four pillars. They are:
- Polymorphism
- Inheritance
- Abstraction
- Encapsulation