Static
Static and non-static problems should be found on the Internet to find some information, the following is the collation of some information.
The existence of a non-static member depends on the instance, so it can also be called an instance member.
The members in the class include:
Data members:
Data members can be divided into static variables, instance variables and two.
Static members: Static member variables are associated with the class, can be used as a "total" in the class variable (is a common expression), he does not rely on the existence of a particular object, access by the class name dot operation alphanumeric variable name to access.
Instance member: an instance member variable is associated with an object, and accessing the instance member variable depends on the existence of the instance.
Function Members:
Methods can be mainly divided into static methods, instance methods
Static method: Static method is not a specific object of the method, static methods can access static member variables, static methods can not directly access the instance variables, can be in the case of the instance function call, the instance variable as a parameter passed to the static method. Static methods also cannot call instance methods directly, and can be called indirectly by first creating an instance of a class and then invoking the instance method through this particular object, but the static method can be invoked.
Instance method: The execution of an instance method is associated with a particular object, and his execution requires an object to exist. Instance methods can directly access static variables and instance variables, instance methods can directly access instance method, and static method, static method access way for class name dot operation alphanumeric variable name. When multiple instance objects exist, there is not a copy of the US-specific instance method in memory, but all objects of the same class share a copy of each instance method (the instance method takes up only "set" space).