Class objects: class names (such as Student)
Instance object: object created by class (xiaoming=Student ())
Class properties can be shared by class objects and instance objects.
Instance attributes can only be owned by instance objects, and class objects cannot be owned.
PS:If you modify class attributes outside the class, you must refer to it through the class object. If you refer to it through the instance object, it actually produces a new instance attribute, modifies the instance attribute without affecting the class attribute, and if you refer to it through the instance object, it refers to the newly generated attribute.
If the instance attribute is deleted, the class attribute continues to be referenced.
Class methods can be referenced by instance objects and class objects, using the decorator @classmethod, in parentheses (cls), and modifying class attributes.
Static methods can also be referenced by instance objects and class objects.
The results are as follows:
The above code is the same. If you delete it, call mmmm.mkj again.
The result is:
Note: the attribute method brackets are self.