int i = 100;
System.out.println (i);
i = 200;
System.out.println (i);
int i = 300;
Perform an error because the same variable name cannot be named within the same scope
About the scope of variables in Java
What is a scope?
In other words, the valid range of variables, in addition to the scope of access is not, such as the company's internal property of the company can not be used, scope has size range only said
The scope of a variable just remember a word, except the curly braces don't know
public static void Main (string[] args) {
int 1 = 100;
}
public void Read () {
System.out.println (i);
}
Classification of variables
Classification based on the position of the variables appearing in the station
Variables declared within a local variable method
Variable of member variable method in vitro declaration
Java Variable Learning notes