Created
October 29, 2013 17:06
-
-
Save bric3/7218689 to your computer and use it in GitHub Desktop.
Guess what could be printed on stdout !
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.net.MalformedURLException; | |
import java.net.URL; | |
import java.util.HashSet; | |
public class URLPuzzler { | |
public static void main(String ... a) throws MalformedURLException, InterruptedException { | |
HashSet set = new HashSet(); | |
set.add(new URL("http://google.com")); | |
System.out.println("containing `new URL(\"http://google.com\")` ? : " + set.contains(new URL("http://google.com"))); | |
Thread.sleep(60000); | |
System.out.println("containing `new URL(\"http://google.com\")` ? : " + set.contains(new URL("http://google.com"))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment