Object Oriented Programming
What is Object-Oriented Programming?
Is a programming paradigm that organizes software design around objects
rather than functions and logic. Objects are instances of classes, which act
as blueprints defining properties (attributes) and behaviors (methods).
Encapsulation
Is the OOP principle that restricts direct access to an object’s properties and
methods, protecting data from unintended modification. It groups data
(variables) and behavior (functions/methods) into a single unit (class) and
controls access using access modifiers (public, private, protected).
Modifier
public Accessible from anywhere.
private Accessible only within the class.
protected Accessible within the class and its child classes.
Abstraction
is an OOP concept that hides the complex implementation
details and only shows the essential features to the user. It
allows developers to work with high-level interfaces without
worrying about the underlying logic.
Inheritance
is an OOP principle that allows one class (child class) to inherit properties
and methods from another class (parent class). This promotes code
reusability and avoids redundancy by allowing child classes to use and
extend the functionalities of a base class.
Polymorphis
m
is an OOP principle that allows different objects to be treated as if they
were the same type while behaving differently. It enables a single
interface (method name) to be implemented in multiple ways by different
classes.