+ 3
Clas methods and static methods
Whts the difference between class and static method
5 Respostas
+ 4
Classmethods AND static methods can be called without an instance.
Try this:
class C:
@classmethod
def f(cls):
print('Method of', cls)
C.f()
The main difference is that static methods have no implicit first argument, neither self (the instance) nor cls (the class).
+ 2
Manisha The main difference is static method can be call without creating the object of class means we can directly access with class.