?? scope.java
字號:
public class Scope
{
public static void main(String[] args)
{
int outer = 1; // Exists throughout the method
{
// You cannot refer to a variable before its declaration
// System.out.println("inner = " + inner); // Uncomment this for an error
int inner = 2;
System.out.println("inner = " + inner); // Now it is OK
System.out.println("outer = " + outer); // and outer is still here
// All variable defined in the enclosing outer block still exist,
// so you cannot redefine them here
// int outer = 5; // Uncomment this for an error
}
// Any variables declared in the previous inner block no longer exist
// so you cannot refer to them
// System.out.println("inner = " + inner); // Uncomment this for an error
// The previous variable, inner, does not exist so you can define a new one
int inner = 3;
System.out.println("inner = " + inner); // ... and output its value
System.out.println("outer = " + outer); // outer is still around
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -