Created
June 2, 2015 12:54
-
-
Save dagezi/55cd0e90510c7c37069e to your computer and use it in GitHub Desktop.
http://java.net .URL#equals resolves domain name!
This file contains hidden or 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.URL; | |
public class UrlTest { | |
public static void main(String argv[]) throws Exception { | |
URL url1 = new URL("http://squiare.github.io/"); | |
URL url2 = new URL("http://google.github.io/"); | |
System.out.println( | |
String.format("\"%s\".equals(\"%s\") = %b", | |
url1.toString(), | |
url2.toString(), | |
url1.equals(url2))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment