× Python Introduction What is Python Python Features Python History Python Applications Python Install Python Path Python Example Execute Python Keywords Constant Variable Statements & Comments Python I/O and Import Operators UnaryBinaryTernary Unary Operators Unary Minus Binary Operators Arithmetic Operators Assignment Operators Relational Operators Logicaloperators Bitwise Operator Ternary Operators Control Statements in Python conditonal Statements IF if else Else If Nested if Switch For loop Nested For Loop While Loop Nested while Loop Unconditonal Statemets Continue Break Pass FUNCTIONS Python Function Function Argument Python Recursion Anonymous Function Python Modules NATIVE DATATYPES Python List Python Numbers Python Tuple Python String Python Set Python Dictionary OOPS PRINCIPALS Encapsulation Class Variable Method Object Or Instance CreationMethod Calling OOPS Syntax And Explanation DATA ABSTRACTION Constructor Inheritance 1.Single or simple Inheritance 2.Multilevel Inheritance 3.Hierarchical Inheritance 4.Multiple Inheritance 5.Hybrid Inheritance Operator Overloading File Operation Python Directory Python Exception Python - Multithreading Python - Database Access Python - CGI Python - Reg Exp Python - Date Python - XML Processing Python - GUI
  • iconPython Online Training In Andhra Pradesh and Telangana
  • icon9010519704

Opening Hours :7AM to 9PM

Object Creation Or Instance Creation In Python


Object Creation Or Instance Creation: In Python
Before creating an object no memory allocate for the class variables at the time of declaration.without allocation of memory space no operation can be performed.To overcome this problem we must create sufficient memory space technically called instantiation of class(in general it is called object creation).
In Python language object is instance of calss(instance allocation of memory space).
Syntax:
objref=ClassName();
object reference can be userdefined name and that holds address of the new memory location.

Method calling and Variable Calling:
The main purpose of the object is to call the properties of class outside it.
Syntax:
objref.variableName;
which can be access the variable name of the class.
objref.methodName();
which can be access method name of class.

Key Points

Image