0% found this document useful (0 votes)
29 views11 pages

The Foundation of OOP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views11 pages

The Foundation of OOP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 11

The Foundation

of OOP

Prepared by: Toni D. Granado


Sample Footer Text

Object-oriented Object-oriented
programming (OOP) is a
Programming programming paradigm that
revolves around the concept
of "objects," which are
instances of classes. Python is
an object-oriented
programming language that
supports OOP principles.

05/13/2024 2
Sample Footer Text

Here are the Classes:


• A class is a blueprint for
basic concepts of creating objects.

the object- • It defines the attributes


(data) and methods
oriented (functions) that the objects
will have.
approach in • Classes are declared using
Python: the class keyword.

05/13/2024 3
Sample Footer Text

Class:

05/13/2024 4
Sample Footer Text

Objects Objects (Instances):


Objects are instances of
classes. They are created
using the class name
followed by parentheses.
Each object has its own set
of attributes and can execute
the methods defined in the
class.
05/13/2024 5
Sample Footer Text

Attributes Attributes: Attributes are


data stored within a class or
instance and represent the
state of the object. They can
be accessed using dot
notation.

05/13/2024 6
Sample Footer Text

Methods: Methods are functions


Methods defined within a class that
operate on the object's data. They
can access and modify the
object's attributes.

05/13/2024 7
Sample Footer Text

Constructor (init): The __init__

Constructor method is a special method in Python


classes that is called when a new
instance of the class is created. It is
used to initialize the object's attributes.

05/13/2024 8
Sample Footer Text

Inheritance: Inheritance allows a class

Inheritance (subclass) to inherit attributes and


methods from another class
(superclass). This promotes code reuse
and allows for hierarchical
organization of classes.

05/13/2024 9
Sample Footer Text

Encapsulation Encapsulation: Encapsulation


is the bundling of data
(attributes) and methods that
operate on the data within a
single unit (class). It helps to
hide the internal state of an
object and only expose the
necessary functionality
through methods.

05/13/2024 10
Sample Footer Text

Polymorphism Polymorphism:
Polymorphism allows objects
of different classes to be
treated as objects of a
common superclass. It
enables methods to be written
to handle objects of a generic
class and work correctly with
objects of any subclass.

05/13/2024 11

You might also like