📄 first_exception.java
字号:
class first_exception{
public static void main(String args[]){
char c; int a,b=0;int[] array=new int[7];
String s="Hello";
try {
a=1/b;
}catch(ArithmeticException ae) {
System.out.println("Catch "+ae);
}
try {
array[8]=0;
}catch(ArrayIndexOutOfBoundsException ai){
System.out.println("Catch "+ai);
}
try{
c=s.charAt(8);
}catch(StringIndexOutOfBoundsException se){
System.out.println("Catch "+se);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -