Java随笔

ExcepTest.java import java.io.*; public class ExcepTest{ public static void main(String args[]){ try{ int a[] = new int[2]; System.out.println("Access element three :" + a[3]); }catch(ArrayIndexOutOfBoundsException e){ System.out.println("Exception thrown :" + e); } System.out.println("Out of the block"); } }

编写了一个异常处理程序测试

posted @ 2020-10-24 20:04  大风吹爱护  阅读(33)  评论(0编辑  收藏  举报