Static and instance variables

A static variable belongs to a class, a class variable, not a class object. No matter how many class objects there are, there is only one copy of a static variable in memory, allowing these class objects to share

 

Instance variables must be attached to the instance object of the class to exist, you need to create the object before accessing the instance variable

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326219942&siteId=291194637