file5.java

来自「学习java编程的好程序」· Java 代码 · 共 29 行

JAVA
29
字号
import java.io.*;
public class file5
{
    public static void main(String[] args)throws Exception 
    {
        int[] a=new int[5];
        try 
        {
            a[10]=1;
        }
        catch(ArrayIndexOutOfBoundsException ae)
        {
            System.out.println(ae);
        }
        catch(ArrayStoreException ae)
        {
            System.out.println(ae);
        }
        catch(ArithmeticException ae)
        {
            System.out.println(ae);
        }
        finally
        {
            System.out.println("发现了异常,并且处理它了!");
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?