Python Online Training In Andhra Pradesh and Telangana
9010519704
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.