This exception rises up
Exception in thread "main" java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
at java.util.ArrayList$Itr.next(Unknown Source)
at noob.Prim_up_to.prim(Prim_up_to.java:72)
at noob.Prim_up_to.<init>(Prim_up_to.java:21)
at _ex.main(_ex.java:11)
Here is the relevant code: http://pastebin.com/w6d0hyXb
Why is it that this happens? I tried using iterator but to no avail. The same exception shows up nevertheless.