system.identityHashcode
时间: 2024-05-22 16:12:03 浏览: 14
The `System.identityHashCode()` method is a built-in method in Java that returns the hashCode value of an object. The hashCode value is a unique integer value assigned to every object in Java. This value is used by the hash-based data structures in Java like HashSet, HashMap, etc. to determine the location of an object in their internal data structure.
The `System.identityHashCode()` method differs from the `Object.hashCode()` method in that it returns the same hashCode value for the same object every time it is called, regardless of any changes made to the object's state. The `Object.hashCode()` method, on the other hand, can return different hashCode values for the same object if its state changes.
It is important to note that the `System.identityHashCode()` method does not guarantee that the returned hashCode value will be unique across all objects in the Java runtime environment. However, it does guarantee that the hashCode value will be unique for each object within the current execution of the program.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)