美文网首页
java中List删除报错 java.util.Concurre

java中List删除报错 java.util.Concurre

作者: 左洁 | 来源:发表于2018-07-15 17:10 被阅读0次

    参考链接

    上代码先

    list中数据是不能在原有集合修改,需要循环删除list中多个元素的,应该使用迭代器iterator方式,不然会报错

    Iterator it = list.iterator();

    while (it.hasNext()){

    it.next();

        it.remove();

    }

    相关文章

      网友评论

          本文标题:java中List删除报错 java.util.Concurre

          本文链接:https://www.haomeiwen.com/subject/lcippftx.html