Java URL hashCode() method

The hashCode() method of URL class creates an integer suitable for the hash table indexing. The hash code is based upon all the URL components relevant to the URL comparison. As such, this operation is a blocking operation.

Syntax

Overrides

hashCode in class Object

Returns

a hash code for this URL.

Example 1

Output:

Enter Url 
https://www.javatpoint.com/java-tutorial
Hashcode for given URL object : 986473352

Example 2

Test it Now

Output:

Both URL Matching
 <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Java ThreadPoolExecutor - Javatpoint</title><link rel="SHORTCUT ICON" href="/images/logo/icon.png" />
<link rel="stylesheet" type="text/css" href="/link.css"/>
<meta name="keywords" content="java, threadpoolexecutor, afterexecute(), allowcorethreadtimeout(), awaittermination(), beforeexecute(), execute(), finalize(), getactivecount(), getcompletedtaskcount(), getlargestpoolsize(), getqueue()"/>......
Next TopicJava URL Class




Latest Courses