Difference between Hash32 and Hash in Java string Object

What is the difference between Hash32 and Hash in a String object

While Debugging, I found that String Object displays hash = 0 and hash32 = 0, as shown in the figure below. Some might explain the reason it appears.

enter image description here

thanks for the answer

+4
source share
1 answer

HashMapPerformance benefits can be “nullified" by supplying carefully selected keys so you face a lot of collisions. This reduces the access time O (1) / any time for HashMapup to O (n), which significantly reduces performance.

hash32 - , String s, , , . :

Java SE 7u6 -...

- , .

- String.

HashMap Java 8 ad-hoc TreeMap Comparable, - , , O (1) O (lg n) O (1) - O (n) - . String Comparable, , , .

+6

Source: https://habr.com/ru/post/1542425/


All Articles