Java URL.hashCode()
Syntax
URL.hashCode() has the following syntax.
public int hashCode()
Example
In the following code shows how to use URL.hashCode() method.
import java.io.IOException;
import java.net.URL;
/*from w w w .ja v a 2s . co m*/
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("http://www.java2s.com");
System.out.println("URL is " + url.hashCode());
} catch (IOException e) {
e.printStackTrace();
}
}
}
The code above generates the following result.