Witam!
Napisałem taką metodę do losowania
public int get()
{
int i = (int) ((Math.random()) * size);
i = liczby.get(i); //liczby to ArrayLista
liczby.remove(i);
this.size = liczby.size();
return i;
}
i zwraca mi taki błąd:
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 3, Size: 3