I know how to remove an element using the remove() function inside a for loop this way :
// ArrayList<Particle> particles;
for(int = 0; i < particles.size(); i++){
if(condition){
particles.remove(i)
}
}
but I'd like to know how to do the same thing using this alternative for loop syntax that I find more elegant :
// ArrayList<Particle> particles;
for(Particle p:particles){
if(condition){
// remove particle
}
}