Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 49 pages
Class notes

Class notes programming notes with example

Document preview thumbnail
Preview 4 out of 49 pages

These OOP notes cover important Object-Oriented Programming concepts including classes, objects, inheritance, polymorphism, encapsulation, abstraction, constructors, and functions. The notes are written in simple language with examples for easy understanding and exam preparation.

Content preview

OBJECT ORIENTED
PROGRAMINING
CHAPTER # 01:




A
Procedural Programming (POP)




H
ES
What it is:



Procedural programming is a way of writing code where you solve problems step by step using
functions.




AY
Idea:

“Do this → then this → then this”
BY
Example (real life):


Making tea
S
TE


1.​ Boil water
2.​ Add tea leaves
3.​ Add sugar
4.​ Pour into cup
O




Each step = a function
N




Key Features:
S




●​ Uses functions (procedures)
●​ Follows top-to-bottom execution
C




●​ Data and functions are separate
●​ Simple and easy for small programs
BS




CODE:

void makeTea() {

boilWater();

addTea();

, addSugar();


}


Object-Oriented Programming (OOP)
What it is:

OOP is a way of programming where you organize code using objects and classes.




A
H
Idea:




ES
“Group data + functions together”


Example (real life):




AY
Think of a Car

Car = Object

●​
●​
Data: color, speed
Functions: drive(), brake()
BY
Key Features:
S

●​ Uses Classes & Objects
●​ Encapsulation (data is protected)
TE


●​ Inheritance (reuse code)
●​ Polymorphism (same function, different behavior)

Everything related is grouped together
O




DIFFERENCE
N




Procedural Object-Oriented Programming
S




1.it is main focus in the function 1 it is used to make the classes and object
C
BS




2.It work step by step execution 2.it is work real world modelingIt




3.It divided into the function 3. it divided into object

4.Data and functions work separately 4. data and function are combined

5.It is less secure 5. it is more secure in data hiding

6.It reusability is limited 6. it has high inheritance

7.It have less flexible 7. it is more flexible

,8.It is good from small programs 8. it is best from large program

Example Example

C,pascal c++,java,python


CLASS AND OBJECT




A
What is a Class?




H
A Class is like a blueprint (design)




ES
Think like this:

If you want to build a house. You first create a map/design.




AY
That design = Class


Example:
BY
Class = Car

It defines:
S

●​ Color
TE


●​ Speed
●​ Functions like drive(), brake()
O




But it’s just a design… not a real car yet
N




What is an Object?
S




An Object is the real thing created from a class
C




Think like this:
BS




Using the house design, you build a real house

That real house = Object

EXAMPLE

Class:

Student

, Objects:

●​ Ali (Roll no: 1, Age: 18)
●​ Ahmed (Roll no: 2, Age: 19)

Real students = objects



What are Access Modifiers?




A
Access Modifiers control who can use your data or methods in a program




H
ES
Simple idea:

“Who is allowed to see or use this?”




AY
Real-Life Example
Think of a house BY
●​ Public → Anyone can enter
●​ Private → Only you can enter your room
●​ Protected → Only family members can enter
●​ Default → Only people in the same house
S
TE


Why Important?

1. Protects your data​
O




2. Prevents misuse​
3. Makes code secure and clean
N




Types of Access Modifiers
S
C




1. Public
BS




Accessible from anywhere

public int age;

Anyone can use it




2. Private

Document information

Uploaded on
May 29, 2026
Number of pages
49
Written in
2025/2026
Type
Class notes
Professor(s)
Computer science department
Contains
All classes
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
10
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions