So i need to delete a specific object under the index number of how many times my loop has passed in an arraylist.
lets say i want to delete my object that has an index 0 on arraylist
but the object on index 1 and index 2 (and so on) still need to be the same index number as before i removed index 0.
for (int i = 0; i < 4 i++) {
player thisPlayer = players.get(i);
if (not important) {
players.remove(thisPlayer);
}
}
if player 1 needs to be removed, the other players need to maintain the same index.
what do i do?