I want to remove an instance of an ArrayList, but with the code I have now it lists the movies removed. I have an ArrayList that takes title
, year
, genre
and balance
. The goal is to remove from the list using only title and year.
I have tried a for-each loop, but that leads to ConcurrentModificationException
error, and I am not sure how use use Iterators to make it work for this example.
It is supposed to remove the instance specified by title and year so that when it lists the moviesAvailable, the list would be updated. However when listing it shows all movies (probably because it is not actually removing the movie).