app12_2.java
来自「java的一些关于多线程」· Java 代码 · 共 22 行
JAVA
22 行
// app12_2,异常的处理
public class app12_2
{
public static void main(String args[])
{
try // 检查这个程序块的程序代码
{
int arr[]=new int[5];
arr[10]=7;
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("index out of bound!!");
}
finally // 这个块的程序代码一定会执行
{
System.out.println("this line is always executed!!");
}
System.out.println("end of main() method !!");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?