















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















Before learning OOPS, we should first understand what programming is.
Suppose you ask your friend,
"Please bring me a glass of water."
Your friend understands your instruction and brings the water.
Similarly,
A computer only understands instructions.
These instructions are called a program.
A person writes these instructions using a programming language like
● Java ● Python ● C ● C++ ● C# ● JavaScript
This process is called Programming.
Programming is the process of writing instructions for a computer to perform a particular task.
A Program is a collection of instructions that tells the computer what to do.
A Programming Paradigm is a style or method of writing programs.
Think of it as different ways to solve the same problem.
Suppose you want to travel from Chennai to Bangalore.
You can travel by
● Bus ● Train ● Car ● Flight
Your destination is the same.
Only the method changes.
Similarly,
A programming problem can be solved using different programming styles.
These styles are called Programming Paradigms.
Types of Programming Paradigms
Example Languages
● C
Example Languages
● Java
● Python
Examples
● Haskell ● Scala
Examples
● Prolog
For now, we only focus on
● POP ● OOPS
POP stands for
Procedure-Oriented Programming
It is the oldest programming approach.
Program
Input Process Print Exit
(Function)(Function)(Function)(Function)
Main()
Input();
Calculate();
Display();
Exit();
}
Everything is divided into functions.
Very easy for beginners.
Small programs execute quickly.
Consumes less memory.
Suitable for
● Calculator ● Student Marks
Anyone can modify data.
The same code is written repeatedly.
Finding errors becomes difficult.
Suppose a Bank has
Customer Data
Deposit()
Withdraw()
Interest()
Loan()
↓
Balance()
All functions can directly change customer data.
If one function accidentally changes the balance,
Every other function is affected.
This is one of the biggest problems of POP.
As software became larger,
POP started creating many problems.
Examples
● Facebook ● WhatsApp ● Google ● Banking ● Amazon ● Railway Reservation
These applications contain millions of lines of code.
Managing them using only functions became very difficult.
Scientists introduced a better approach called
Objec t
State Behavior
Car Color, Model, Speed
Start, Stop, Brake
Stude nt
Name, Roll No Study, Write Exam
Mobil e
Brand, RAM Call, Message
Fan Speed Rotate
TV Channel Play
Program
|
Object1 Object2 Object
Data + Methods
Function
↓
Data
Object
Data
Methods
There are six major features of OOPS:
Hospital
Registration()
Doctor()
Medicine()
Billing()
Exit()
Only functions are considered.
OOPS Approach
Hospital
Patient Object
Doctor Object
Medicine Object
Staff Object
Bill Object
Each object stores its own data and methods.
This makes the software organized.
Companies like
● Microsoft ● Google ● Amazon ● Oracle ● IBM ● Infosys ● TCS ● Wipro
prefer OOPS because it helps build large, maintainable, and reusable software.
OOPS is used in
● Banking Software ● ATM Machines ● Hospital Management ● College Management ● Railway Reservation ● Airline Reservation ● Mobile Apps
Different developers can work on different classes and objects.
Matches how we think about real-world entities.
Easy to add new features.
The same code doesn't need to be written repeatedly.
Beginners need time to understand concepts.
Objects require memory.
Creating and managing objects adds some overhead.
A simple calculator may not need a full OOPS design.
Programming
↓
Programming Paradigm
↓
Procedure-Oriented Programming (POP)
Problems
Need Better System
Object-Oriented Programming (OOPS)
Object