I tried to make a simple roulette, however when I try to remove all data of a specific player (because they have lost all money) my game crashes and displays the error:

```
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
    at java.util.ArrayList.rangeCheck(ArrayList.java:653)
    at java.util.ArrayList.get(ArrayList.java:429)
    at exam.Exam.main(Exam.java:330)

```

This is my line of code that crashes (I live in Denmark so the names are in danish):

Spiller is my `Arraylist`, `antalSpillere` is the amount of players, 
`denneSpiller` is the specific data of a player I want removed.

```
           for (int i = 0; i < antalSpillere; i++) {

            Spiller denneSpiller = spillere.get(i);

            if (denneSpiller.bank < 1){

                spillere.remove(denneSpiller);
                antalSpillereCheck ++;

            }
            else {
                antalSpillereMedPengeIBanken ++; 

            }

        }

```

The game crashes first when the for loop ends, and wouldn't crash if I removed the `spiller.remove(denneSpiller);`.