11、[简答题] 【看代码,分析结果】 根据给出的相应代码,分析可能产生的结果。 public static void main(String[]args){ int arr[]={1,2}; System.out.println(arr[2]); }

 

 索引值2大于等于数组arr的长度时,报数组索引越界异常ArrayIndexOutOfBoundsException

posted @ 2022-04-09 17:09  不只是智能hello  阅读(42)  评论(0)    收藏  举报