Vector使用常见异常

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);