0 votes
in JAVA by
Write code to remove elements from ArrayList while iterating?

1 Answer

0 votes
by

 Key here is to check whether candidate uses ArrayList's remove() or Iterator's remove(). Here is the sample code which uses right way o remove elements from ArrayList while looping over and avoids ConcurrentModificationException.

...