Skip to content

Instantly share code, notes, and snippets.

@davetron5000
Created September 4, 2009 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetron5000/181043 to your computer and use it in GitHub Desktop.
Save davetron5000/181043 to your computer and use it in GitHub Desktop.
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