Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

OOPS

 TOPICS COVERED
 DEFINITION
 COMPONENTS
 CLASS DEFINITION
 OBJECT DEFINITION
 VARIABLE DEFINITION
 TYPES OF VARIABLES
DEFINITION
• OOPS is abbreviated as ,
• ( Objects Oriented Programming Paradigm Structure).
• Using this structure collec of func will be groomed (or)
contained in a single class and it will be accessed by an
object.
• Containing or capsulating a ‘N’ number of functions as
possible.
• EXAMPLE: A Capsule containing a list of medical substances.
DEFINITION
• Polymorphism - It enables a single interface to be used for multiple
implementations, providing flexibility and extensibility in code design.
• Self - keyword is a convention used to refer to the instance of a class
within the class itself. It acts as a reference to the current object on
which a method is being invoked. self is a special keyword is used in
oops,this allows used to access class variable and its properties.
• __init__ constructor – the primary purpose of __init__ method is to
initialize the attributes(variables) of an object with values provided
during object creation.
• Variables
COMPONENTS
• Classes - collection of objects
• Objects - instance of
class(eg.bool,str,int,list,dict,tuple,function,type)
• Data abstraction - where user is kept unaware of the
functions property.
• Inheritance - passing down properties of parent class to
child class (eg.passing down father's gene to son's ).
• Data encapsulation - the concept of bundling data and
methods in a single unit.
CLASS DEFINITION
• class means internal data model references of the
stored methods functionality inside a container.
• Class means collection of objects.
• Class is a blueprint to create objects.
• Class is a container for collection of function (or) methods.
• Class creates local name space for all of its functions. (temp)
• Class is a collection of different states and behaviors.
• Class is a collection of data(variables) and
member(functions).
CLASS DEFINITION
• Class is a collection of properties and attributes.
• Real time example - bike as a class.
• Properties of a bike(class)-handlebar/abs/fuel tank/liquid
cooler/drl headlamps.(this example denotes
multifunctionality)
• Properties - features.
• Attributes - values.
• States - dedicated functions.
OBJECT DEFINITION

• Object is an instance of class.

• 'INSTANCE' means data model reference of a class.

• In simple words objects means controller of class.

• Methods -means functions present inside class.


VARIABLE DEFINITION
• Variables provide a way to label and refer to data, making
it easier to work with and manage information in the
code.
TYPES OF VARIABLES
• Class variables
• if a variable is declared inside the class but outside of all its
class functions.
• Local variables
• If a variable is declared inside any specific function of a
class .
• Global variables - If a variable is declared out side of class
and its functions but still accessible by the class functions
with the funcs with the help of global keyword.
REAL TIME EXAMPLE OF
CLASS,CONSTRUCTOR,OBJECT

You might also like