Is there a way that you can use the javascript array.pop() method in java? It would really help if someone finds a way of doing it. I have tried this:
int neighbor = neighbors.get(neighbors.size()-1);
neighbors.remove(neighbors.size()-1);
But it doesn't work i'm getting a error:
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)