0% found this document useful (0 votes)
31 views

4 Pillars of Oop: 1. Sub Class

The document discusses the four main pillars of object-oriented programming (OOP): inheritance, polymorphism, abstraction, and encapsulation. It defines inheritance as a class's ability to inherit characteristics from another class. Polymorphism is described as a message taking different forms, with two types: compile-time and run-time. Abstraction is presenting essential information while hiding details. Encapsulation binds data and functions that use the data, and keeps them safe from outside access and misuse.

Uploaded by

INAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

4 Pillars of Oop: 1. Sub Class

The document discusses the four main pillars of object-oriented programming (OOP): inheritance, polymorphism, abstraction, and encapsulation. It defines inheritance as a class's ability to inherit characteristics from another class. Polymorphism is described as a message taking different forms, with two types: compile-time and run-time. Abstraction is presenting essential information while hiding details. Encapsulation binds data and functions that use the data, and keeps them safe from outside access and misuse.

Uploaded by

INAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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