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.

Related questions

0 votes
asked Oct 24, 2020 in JAVA by sharadyadav1986
+1 vote
asked Apr 9, 2021 in JAVA by Robindeniel
...