KEMBAR78
OOP Python | PDF | Object Oriented Programming | Class (Computer Programming)
0% found this document useful (0 votes)
14 views9 pages

OOP Python

This chapter is helpefull for student who are seeking to learn python opp and all the topic are disscused

Uploaded by

fall3210060
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)
14 views9 pages

OOP Python

This chapter is helpefull for student who are seeking to learn python opp and all the topic are disscused

Uploaded by

fall3210060
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/ 9

Object oriented

programming
OOP:

 Object oriented programming (Oop) is a programming technique


in which programs are written on the basis of object.

 An object is a collection of data and functions. And object may


represent a person, thing or place in real world.

 Objects are Real world Entities.

 And object oriented programming is a powerful technique to


develop software.

 Example of Object oriented programming are as

 C++,Java,Smalltalk,CLOS,Eiffel,Python.
Features of Object Oriented Programming

I. Classes

II. Object

III. Constructors

IV. Inheritance

V. Polymorphism
Features of OOP

 Object :OOP provide the facility of programming based on


objects. An object is an entity that consist of data and
function.

 Classes: classes are the design for creating objects. OOP


provides facility to design a class. All properties and functions
of an object are specified in classes.

 Real World Modeling : OOP is based on real-world


modeling .the entities in the have different properties and
working capabilities. Similarly the objects have data and
functions. Data represents the properties and function
represents the working of the objects.
Conti…

 Reusability: OOP allows the programmer to reuse the data


and code. It uses the technique of inheritance to use the code
of existing class to create new class.

 Encapsulation: OOP allows the programmer to hide the


important data from the user.

 Polymorphism: is the ability of an object to behave in


multiple ways.
Objects
 An object represents an entity in the real world such as a
person , thing or concept etc.
 it is identified by its name. an object consist of the following:
 Properties : these are the characteristics of an object.
 Functions : these are the action that can performed by an
object.

 Examples are
 Physical Objects : vehicle such as Car, Bus, truck etc.
 Element of Computer Enivornment : Windows, Menus,
mouse, keyboard etc
Properties of Object
 Each object has its own properties. These properties can be used to
describe the object. For example the properties of An object Person
can be as follows:
 Person : name, age, weight, Height
 Car : Color, Price, Model, Engine Power
 The set of values of the attribute of a particular object is called its
state. It means that the state of an object can be determined by the
values of its attributes.
 Properties of An object Car follows: Car

Model
Honda Civic
Color
Gray
Price
200000
Function of Object
 The action that can perform by an Object is known as functions or
methods. An object can perform different tasks and actions. For
example the object car can perform the following functions:
 Car : Stop, Accelerate, reverse
 The set of all functions of an objects represents the behavior of the
object . It means that the behavior of an object can be determined by
the list of functions of that object.
 Function of an object Car as Follows:
Car

Start
Stop
Accelerate
Reverse
Classes
 A collection of objects with the same properties and functions is
known as class.
 The class is like a ‘Blueprint’ or ‘Template’ for creating Objects.
 A class is used to define object. It is used as a model for creating
different objects of same type.
 For example : a class person can be used to define the
characteristics and function of a person.
 The person class can be used to create different objects such as
Ali, Usman ,Kamal, Abdullah etc. All objects of person class will
have the same characteristics and functions. However the values
of each object can be different. the values are assigned when an
object is created.
 Each object of a class is known as instance of its class for example
Ali ,Usman and Abdullah are three instances of person Class.

You might also like