<pre name="code" class="java">for(int i = 0 , len= list.size();i<len;++i){
if(list.get(i)==XXX){
list.remove(i);
} - }
上面的程序出现如下异常怎么回事?麻烦大侠们给说一下.
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3 - at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source) - at ListDemo.main(ListDemo.java:20)
|