Comb:
Depending on where you define the variables, you can divide the variables into two main categories: member variables and local variables.
member variables (commonly known as global variables): variables defined in a class. is divided into instance variables and class variables (also become static variables).
instance variable: without static decoration, you need to instantiate the class before it can be accessed through the instance, and you cannot access the instance variable through the class. Instance variable, which means that the program can access the instance variable of the instance as long as the instance exists.
class variable: modified with static, the program can access class variables of the class as long as the class exists
The following example describes access rules for static inner classes and instance variables and class variables for this class:
Local variables: variables defined in the method. According to the definition of different forms can be divided into three kinds: formal parameters, method local variables, code block local variables
Parameter : the variable defined when defining the method signature, the scope of the formal parameter is valid throughout the method;
method local variable: a local variable defined in the body of a method, scoped from the place where the variable was defined, to expire at the end of the method;
code block local variable: a local variable defined in a code block where the scope of the local variable takes effect from where the variable is defined, with the end of the code block invalidated.
Static variables are variables that use static modifiers, which are a one-to-a-kind relationship with class variables???
Answer: Yes, refer to https://www.douban.com/note/513499371/
Java: Member variables, local variables, and static variables