You are on page 1of 5

INAAM ULLAH KHAN FA19-BCS-061

4 PILLARS OF OOP
 INHERITANCE
 POLYMORPHISM
 ABSTRACTION
 ENCAPSULATION

Inheritance
Inheritance is the capability of a class to derive the
characteristics of another class. It is the most important feature in
OOP. There are two types of classes in inheritance
1. Sub Class
The class which inherits properties from other class in known as
sub class.
2. Super Class
The class whose properties are inherited by other class is known
as super class.
INAAM ULLAH KHAN FA19-BCS-061

Polymorphism
The word polymorphism means having many
forms. In simple words, we can define polymorphism as the
ability of a message to be displayed in more than one form.
There are two types of polymorphism
1 Compile Time Polymorphism
2 Run Time Polymorphism
INAAM ULLAH KHAN FA19-BCS-061

Abstraction
Abstraction means displaying only essential information and
hiding the details. Data abstraction refers to providing only
essential information about the data to the outside world, hiding
the background details or implementation.
INAAM ULLAH KHAN FA19-BCS-061

Encapsulation
Encapsulation is an Object Oriented Programming concept that binds
together the data and functions that manipulate the data, and that keeps
both safe from outside interference and misuse. Data encapsulation led to
the important OOP concept of data hiding.
INAAM ULLAH KHAN FA19-BCS-061

You might also like