OOP Concepts in Python: Classes, Objects, Inheritance, Study notes of Software Engineering

It is useful to study and learn

Typology: Study notes

2021/2022

Uploaded on 11/04/2022

sangekari-shiva
sangekari-shiva 🇮🇳

5

(1)

5 documents

1 / 54

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CLASS &
OBJECTS
P.Raja,
Assistant professor in ES(D4), SEEE, LPU
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download OOP Concepts in Python: Classes, Objects, Inheritance and more Study notes Software Engineering in PDF only on Docsity!

CLASS &

OBJECTS

P.Raja, Assistant professor in ES(D4), SEEE, LPU

OUTLINE

 OOP Terminology  Creating classes  Creating instance objects  Accessing attributes  Class Inheritance  Overriding methods  Data hiding  Function overloading

OOP TERMINOLOGYFunction overloading − The assignment of more than one behavior to a particular function. The operation performed varies by the types of objects or arguments involved.  Instance variable − A variable that is defined inside a method and belongs only to the current instance of a class.  Inheritance − The transfer of the characteristics of a class to other classes that are derived from it.  Instance − An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle.

OOP TERMINOLOGYInstantiation − The creation of an instance of a class.  Method − A special kind of function that is defined in a class definition.  Object − A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods.  Operator overloading − The assignment of more than one function to a particular operator.

 Every object has the following property.

  • (^) Identity : Every object must be uniquely identified.
  • (^) State : An object has an attribute that represents a state of an object, and it also reflects the property of an object.
  • (^) Behavior : An object has methods that represent its behavior.

Class : Person

  • (^) State : Name, Sex, Profession
  • (^) Behavior : Working, Study  Syntax to create a object Object_name=class_name(arguments)