How to overwrite a HashSet element in Java while iterating over it
<p>Is it possible to overwrite some HashSet element (not necessarily the one iterated) while iterating over it. I want to know of a way apart from removing, editing and then re-adding it?
The reason I am asking this is because using remove while iterating always gives the java.util.ConcurrentModificationException. I figured out that there is no method to overwrite a set element.</p>

<p>Any help will be appreciated.</p>

<p>Thanks,</p>

<p>Somnath </p>
