What do you want to save?
Add Code snippet
New code examples
-
Java 2021-09-18 14:08:02
Why String is popular HashMap key in Java?
Since String is immutable, its hashcode is cached at the time of creation and it doesn't need to be calculated again. This makes it a great candidate for key in a Map and its processing is fast than other HashMap key objects. This is why String is mostly ... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5