首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Vector使用常见异常

2012-12-21 
Vector使用常见错误java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 15??? 1、检查V

Vector使用常见错误

java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 15

??? 1、检查Vector是否越界。

??? 2、当实例化一个Vector以后,想要直接用add方法,需要设置大小。例如

??????? Vector<Integer> pw = new Vector<Integer>();
??? ??? pw.setSize(16);

热点排行