?? testcatchexception.java
字號:
public class TestCatchException {
public static void main(String args[]) {
int num[]=new int[2];
try {
for(int i=0;i<3;i++) {
num[i]=i;
System.out.println(" num["+i+"]="+i);
}
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println("數組下標越界引起的異常");
e.printStackTrace();
}
finally {
System.out.println("程序執行期間發生了異常!!");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -