Created
September 4, 2009 18:54
-
-
Save davetron5000/181043 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> java -cp . Test | |
I've got: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment