Introduction To OOP
Introduction To OOP
● Objects are instances of classes, which act as blueprints for creating these
objects. The primary goal of OOP is to improve the clarity, modularity, and
reusability of code.
Key Concepts in OOP:
● Encapsulation:
1. Encapsulation refers to the bundling of data and methods that operate on that
data into a single unit, known as a class.
2. It helps in hiding the internal details of an object and exposing only what is
necessary. This enhances security and reduces complexity.
● Inheritance:
1. Inheritance allows a class (subclass or derived class) to inherit properties and
behaviors from another class (superclass or base class).
2. This promotes code reuse, as common attributes and methods can be defined
in a base class and inherited by multiple subclasses.
● Polymorphism:
3. This enables flexibility and extensibility in code, as the same method can
be used for different types of objects.
● Abstraction: