从数组列表中删除每个循环的对象
我想在完成对象后从中删除它,但我找不到方法来做到这一点。尝试像下面的示例代码中那样删除它并不想工作。如何访问此循环中当前对象的迭代器以将其删除?ArrayListpx
for( Pixel px : pixel){ 
[...]
  if(px.y > gHeigh){
     pixel.remove(pixel.indexOf(px)); // here is the thing
     pixel.remove(px); //doesn't work either
  }
}
 
					 
				 
				    		 
				    		 
				    		