4 Basic Principles of OOPs

2022-03-13

4 Basic principles of OOPs are:
  1. Abstraction
  2. Encapsulation
  3. Inheritance
  4. Polymorphism
Abstraction: Its about modeling the relevant attributes and interactions of entities as classes to define an abstract representation of a system.
It's a modelling or design concept in which we define the methods & attributes or members of entities via classes or interfaces.
Abstraction separates the interface from implementation. An abstraction focuses on the outside view of an object's essential behavior from its implementation.

Encapsulation is the process of hiding the internal implementation of an object. Hides
 the internal state and functionality of an object and only allowing access through a public set of functions.

Inheritance: ability to create new create new abstractions based on existing abstractions. Inheritance enables hierarchical relationships to be represented and refined.

Polymorphism: Ability to implement inherited properties or methods in different ways across multiple abstractions. Polymorphism allows objects of different types to receive the same message and respond in different ways.

0 comments: