Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

  • 场景:eclipse中编写java中用到数组

  • 问题:

      程序不报错但是运行过程中 终止,显示字样

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1

  • 截图:

  

 

  • 原因:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException

这句话表示异常出现在main这个线程里面,错误是java.lang.ArrayIndexOutOfBoundsException。这个错误是你下标获取超出范围了,一般是例如你数组长度为2.但是你获取数组[3].这时候就会报这个错

posted @ 2016-09-21 08:53  cxccc  阅读(661)  评论(0编辑  收藏  举报