Java URL hashCode() 方法

2025年3月24日 | 1 分钟阅读

URL 类的 hashCode() 方法创建一个适用于哈希表索引的整数。哈希码基于与 URL 比较相关的所有 URL 组件。因此,此操作是一个阻塞操作。

语法

覆盖

Object 类中的 hashCode

返回值

此 URL 的哈希码。

示例 1

输出

Enter Url 
https://tpointtech.cn/java-tutorial
Hashcode for given URL object : 986473352

示例 2

输出

Both URL Matching
 <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>Java ThreadPoolExecutor - tpointtech</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()"/>......
下一个主题Java URL 类