4 votes

Why can a Set be modified in an Apex loop but not a List?

In Iterating Collections, we are instructed: Collections can consist of lists, sets, or maps. Modifying a collection's elements while iterating through that collection is not supported and causes an ...
sfdcfox's user avatar
  • 489k

Only top scored, non community-wiki answers of a minimum length are eligible