Object Oriented Programming
Presented by
Dr. Pradeep Kumar
Object Oriented Programming
Object-Oriented Programming (OOP) is a methodology to design a program using
classes and objects.
Advantages of Object Oriented Programming
Simplifies software development.
Maintenance and troubleshooting.
Collaborative development.
Security. Class
Reusability.
Productivity. Inheritance Object
Easily upgradable.
OOP
OOP are based on 4 pillars apart from class and objects. Encapsulation Polymorphism
Abstraction
Class and Object
Class is a collection of objects and there attributes, and operations.
Class is a blueprint that object follows. A Class consist of ‘N’ Number of
Object.
Objects are instances of a class, which contains a Real world Entity.
Class Object Human Car
Name Company
integer 2, 7, 14
Age Engine
float 4.6, 7.2
Hight Flue capacity
Constructor
A constructor is a special method in a class that is automatically called when an object of
the class is created. It is used for initializing the attributes or properties of the object.
Inheritance
Acquiring the properties of one class to another class is called Inheritance.
Employ Four Wheeler
Salary Engine
Fuel Tank
Holidays
No. of Seats
Working Hours
Security Electrician
Flat
Salary Salary
Holidays Holidays No. of Rooms
Working Hours Working Hours No. of balcony
Working Shift Accommodation
Floor
Example
Polymorphism
The word “Polymorphism” means having different forms.
The same class method can work differently for different objects.
Thank You