?? test.java
字號:
public final class Test{
public static int totalNumber= 5 ;
public final int id;
public Test(){
id = ++totalNumber;//只能在構造方法中給final變量賦值
}
public static void main(String[] args) {
Test t = new Test();
//t.id=10;
System.out.println(t.id);
final int i = 10;
final int j;
j = 20;
//j = 30; //非法
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -