Java BitSet hashCode() 方法

7 Jan 2025 | 1 分钟阅读

Java BitSet 类的 hashCode() 方法返回此 BitSet 的哈希码值。哈希码的值仅取决于此 BitSet 中设置的位。

语法

参数

不适用

返回值

hashCode() 方法返回此 BitSet 的哈希码值。

Exception

不适用

兼容版本

Java 1.0 及以上版本

示例 1

输出

bitset1: {0, 1, 2, 3}
bitset1 hash code: 1245
bitset2: {5, 6, 7, 8}
bitset2 hash code: 1330

下一个主题Java-bitset-get-method