TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Java HashMap.HashCode() Not Unique With String Keys And Values

2 pointsby codercowboyover 6 years ago

1 comment

DerekLover 6 years ago
The HashMap docs say: “This class makes no guarantees as to the order of the map; in particular, it does not guarantee that the order will remain constant over time.” This utility function depends on the order of the entries, so it can return different hashes even when the keys and values in the map are the same.<p><a href="https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;8&#x2F;docs&#x2F;api&#x2F;java&#x2F;util&#x2F;HashMap.html" rel="nofollow">https:&#x2F;&#x2F;docs.oracle.com&#x2F;javase&#x2F;8&#x2F;docs&#x2F;api&#x2F;java&#x2F;util&#x2F;HashMap....</a>