Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
import java.util.*;
public class Test
{
public static void main(String args[])
{
Set<String> myStrings = new HashSet<String>();
myStrings.add("final");
myStrings.add("is");
myStrings.add("often");
myStrings.add("a lie");
go(myStrings);
System.out.println("I've got:");
for (String o: myStrings) {
System.out.println(o);
}
}
public static void go(final Set<String> s) {
s.clear();
}
}
> java -cp . Test
I've got:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment