I've an ArrayList in Java of my class 'Bomb'.
This class has a method 'isExploded', this method will return true if the bomb has been exploded, else false.
Now I'm trying to iterate through this arraylist, call this method isExploded and remove the element from the list if it returns true.
I know how to iterate:
for (Iterator i = bombGrid.listIterator(); i.hasNext();) {
if () {
i.remove();
}
But I've no idea how to access the method isExploded of the Bomb class itself via the iterator. Does anyone know the answer to this?
Sincerely,
Luxo