Removing all occurrences of an element within an array (setting it to null)
<p>I am attempting to set all occurrences of an element to an array if it is found via a linear search. Let's say the array is as follows:</p>

<pre><code>[Steve, Steve, John, Mike, Gary, Bob, Susan, Mike, Sarah]
</code></pre>

<p>Let say if I want to set all occurrences of Mike to null. I've tried the following:</p>

<pre><code>for (int i = 0; i &lt; iTMembers.length; i++) {
    if (iTMembers[i].equals(memberName)) {
        iTMembers[i] = null;
        break;                              
    }               
}
</code></pre>

<p>The problem however is that it only sets one Mike (String Literal Element) to null and the other one is still present. What can I do? Thanks!</p>