• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 4 fuera de 49 páginas
Notas de lectura

Class notes programming notes with example

Document preview thumbnail
Vista previa 4 fuera de 49 páginas

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.

Vista previa del contenido

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

Información del documento

Subido en
29 de mayo de 2026
Número de páginas
49
Escrito en
2025/2026
Tipo
Notas de lectura
Profesor(es)
Computer science department
Contiene
Todas las clases
$10.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
0
Seguidores
0
Artículos
11
Última venta
-



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes