类方法和静态方法都实例化的对象无关,但到底有什么区别呢

    1. class Employee:
    2. @classmethod
    3. def classmthd(*args):
    4. return args
    5. @staticmethod
    6. def staticmthd(*args):
    7. return args
    8. # 类方法
    9. print(Employee.classmthd())
    10. print(Employee.classmthd('test'))
    11. # 静态方法
    12. print(Employee.staticmthd())
    13. print(Employee.staticmthd('test'))
    1. (class '__main__.Employee',)
    2. (class '__main__.Employee', 'test')
    3. ()
    4. ('test',)