On the topic of variables, was troubled for a long time, today checked the definition of variables. Let's take a look at the topic:
The following statements about variables and their ranges are not correct ():
A. Instance variables are member variables of a class
B. Instance variable with keyword static declaration
C. Local variables defined in a method are created when the method is executed
D. Local variables must be initialized before they are used
First, explain the definition of the variable.
1. The members include instance variables and class variables.
2. The instance is not modified by static.
3. Class variables can be modified by static.
See a program:
Class a{
private static int A;
private int temp;
}
(1) Instance variables
To access temp, create an object, example a t = new A ();
T.temp ();
(2) class member variable
A can be accessed directly, A.A access.
The difference is whether you need to create an object.
Forget to say, the answer to the question B C
Variable ___ Explanation