Article From:https://www.cnblogs.com/mexh/p/9967811.html

Class variables
Variable variables as class variables: For lists, dictionaries, custom classes, if they are class variables, they are referred to. That is, all object class variables share a memory address.
Invariant variables as class variables: For INT, STRING, which is an immutable variable, if it is regarded as class variables, it is passed value. That is, all object class variables have their own memory addresses.
Two. Object variables
Whether it is a variable variable or an immutable variable, as long as it is placed in the constructor, it is a value transfer. That is, each object has its own object attributes.

 

For example, please refer to:
https://www.cnblogs.com/turtle-fly/p/3280610.html

Leave a Reply

Your email address will not be published. Required fields are marked *