Object Oriented
Programming I
,Classes and Objects
, Introduction
OOP is a programming paradigm built around the
concept of "objects," which can contain both data
and the code that manipulates that data.
Unlike traditional procedural programming, which
organizes code into a sequence of instructions,
OOP models the real world by representing entities
as objects.
Think of a car: it has properties like color, model,
and year (data), and behaviors like accelerating,
braking, and turning (code).
An object bundles these properties and behaviors
together.
3
SPC2204: Object Oriented Programming 1
, Introduction
What Are Classes and Objects?
In the realm of Object-Oriented Programming (OOP),
classes and objects form the fundamental building
blocks of program design and implementation.
Understanding these concepts is crucial for
transitioning from procedural programming to object-
oriented programming paradigms.
Historical Context:
Procedural programming (like C) focuses on functions and
procedures that operate on data
Object-oriented programming (like C++) focuses on objects
that contain both data and the functions that operate on
that data
This approach better mirrors how we think about real-
world entities and their interactions
4
SPC2204: Object Oriented Programming 1
Programming I
,Classes and Objects
, Introduction
OOP is a programming paradigm built around the
concept of "objects," which can contain both data
and the code that manipulates that data.
Unlike traditional procedural programming, which
organizes code into a sequence of instructions,
OOP models the real world by representing entities
as objects.
Think of a car: it has properties like color, model,
and year (data), and behaviors like accelerating,
braking, and turning (code).
An object bundles these properties and behaviors
together.
3
SPC2204: Object Oriented Programming 1
, Introduction
What Are Classes and Objects?
In the realm of Object-Oriented Programming (OOP),
classes and objects form the fundamental building
blocks of program design and implementation.
Understanding these concepts is crucial for
transitioning from procedural programming to object-
oriented programming paradigms.
Historical Context:
Procedural programming (like C) focuses on functions and
procedures that operate on data
Object-oriented programming (like C++) focuses on objects
that contain both data and the functions that operate on
that data
This approach better mirrors how we think about real-
world entities and their interactions
4
SPC2204: Object Oriented Programming 1