Why Static Methods? =================== @staticmethod def stattcimethodname(self,par1,par2,..): definition X-app: class app1: met1: definition met2: definition class app2: met3: definition met4: definition met1: static methods allow you to isolate the utility methods into different sub-modules. Why class method? ================ @classmethod def classmethodname(cls,par1,par2): implementation X-app: class a1: @classmethod met1: implementation met2: definition class a2: class method can bound to the class but not to the instance of the class. ====================================== Garbage Collection: =================== C++ ==> OOP Concepts class object create : for need destruct : which are not in need memory issues for the application to run Python, is an assistant which is called "garbage collector" can use to destruct the objects automatically when are not in use. Enabling and Disabling Garbage Collector: ========================================= In python, the garbage collector can be enabled automatically. To disable the garbage collector: 1) gc.isenabled() used to check whether the garbage collector is enable or not. ==> True ==> if the garbage collector is in enable state. ==> False ==> if the garbage collector is in disable state. 2) gc.disable() ==> for disabling of garbage collector. ==> True ==> if the garbage collector is disabled ==> False ==> otherwise 3) gc.enable() ==> we should import garbage collector. Syntax: import gc import gc # checking of garbage collector, whether it is in enable state or not print(gc.isenabled()) # disabling of garbage collector gc.disable() print(gc.isenabled()) # eanabling of garbage collector gc.enable() print(gc.isenabled()) Ex: class abc: m1: m2: o1 = abc() ==> 1kb o2 = abc() ==> 1kb o3 = abc() ==> 1kb o1.m1() o1.m2() have a meory of 10kb ==> abc o1.m1() ==> 2kb o1.m2() ==> 2kb remaining ==> 10-7 ==> 3kb 02.m2() ==> 2kb 01.m1() ==> 2kb ==> error ==> out of memory garbage collector 03 ==> free ==> 1kb smart phone ==> playstore gaming app ==> 80mb ==> install, on our phone, 80 mb of memory is reserved for the app f1 ==> obj1 f2 ==> obj2 f3 ==> obj3 f4 ==> obj4 ==> 20mb f5 ==> obj5 f5() f5() 80