0% found this document useful (0 votes)
9 views8 pages

Introduction To OOP

The document provides an introduction to Object-Oriented Programming (OOP), highlighting its key concepts such as encapsulation, inheritance, polymorphism, and abstraction, which enhance code clarity, modularity, and reusability. It contrasts OOP with procedural programming, noting differences in structure, security, and data handling. Examples of popular programming languages for both paradigms are also provided.

Uploaded by

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

Introduction To OOP

The document provides an introduction to Object-Oriented Programming (OOP), highlighting its key concepts such as encapsulation, inheritance, polymorphism, and abstraction, which enhance code clarity, modularity, and reusability. It contrasts OOP with procedural programming, noting differences in structure, security, and data handling. Examples of popular programming languages for both paradigms are also provided.

Uploaded by

sohanxt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Introduction to Object

Oriented Programming (OOP)

Course Code: CSE0613201


Lecturer: Sumaiya Tanjil Khan (STK)
What is Object-Oriented Programming (OOP)?
● Object-Oriented Programming (OOP) is a programming paradigm that organizes
software design around the concept of "objects," which can contain data in the
form of fields, and code in the form of procedures, often known as methods.

● 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:

1.Polymorphism means "many forms", and it occurs when we have many


classes that are related to each other by inheritance.

2. Polymorphism allows objects to be treated as instances of their parent


class, even if they are actually instances of a subclass.

3. This enables flexibility and extensibility in code, as the same method can
be used for different types of objects.

● Abstraction:

1. Abstraction involves simplifying complex systems by modeling


classes based on the essential properties and behaviors they share.

2. It provides a high-level view of the system and focuses on what an


object does rather than how it achieves its functionality.
Procedural Programming
● Procedural Programming can be defined as a programming model which is
derived from structured programming, based upon the concept of calling
procedure. Procedures, also known as routines, subroutines or functions, simply
consist of a series of computational steps to be carried out. During a program’s
execution, any given procedure might be called at any point, including by other
procedures or itself.

● Popular procedural programming languages include C, Pascal, and Fortran.


Procedural Programming vs Object-
Oriented Programming
Procedural Programming Object-Oriented Programming

In procedural programming, the In object-oriented programming,


program is divided into small parts the program is divided into small
called functions. parts called objects.

Procedural programming follows a Object-oriented programming


top-down approach. follows a bottom-up approach.

There is no access specifier in Object-oriented programming has


procedural programming. access specifiers like private,
public, protected, etc.

Procedural programming does not Object-oriented programming


have any proper way of hiding data provides data hiding so it is more
so it is less secure. secure.
In procedural programming, there In object-oriented programming,
is no concept of data hiding and the concept of data hiding and
inheritance. inheritance is used.

Code reusability absent in Code reusability present in object-


procedural programming. oriented programming.

Examples: C, FORTRAN, Pascal, Examples: C++, Java, Python, C#,


Basic, etc. etc.

You might also like