language: Java (sun-jdk-1.7.0_10)
date: 264 days 0 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import java.util.*;
import java.lang.*;
 
class Main
{
public static void main(String[] args) {
    Set<String> strs = new HashSet<String>();
    strs.add("one");
    strs.add("two");
    strs.add("three");
 
    for (String str : strs) {
        //note the typo: twos is NOT in the set
        if (str.equalsIgnoreCase("two")) {
            strs.remove(str);
        }
    }
}
}