标签:
角标越界异常,空指针异常
1 public class Array_Question { 2 public static void main(String[] args) { 3 int[] arr5={3,3,4,5,5}; 4 System.out.println(arr5[5]);//ArayIndexOutOfBoundsException:5,操作数组时,访问到了不存在的角标 即角标越界异常 5 6 int[] arr6={3,3,4,5,5}; 7 arr6=null; 8 System.out.println(arr6[5]);//NullPointerException,空指针异常 9 } 10 }
标签:
原文地址:http://www.cnblogs.com/LO-ME/p/3547961.html