单线程也报 ConcurrentModificationException,我想了一晚上没想通 九月底做购物车清理,需求是把库存为 0 的商品从列表里剔掉。我写得很顺手: for (CartItem item : cartItems) { if (item.getStock() == 0)