Skip to content

Instantly share code, notes, and snippets.

@luisoos
Last active January 30, 2022 16:29
Show Gist options
  • Save luisoos/23288b77d9a316f115bce7d33f6262d9 to your computer and use it in GitHub Desktop.
Save luisoos/23288b77d9a316f115bce7d33f6262d9 to your computer and use it in GitHub Desktop.
Simple Hash in Java
// These arrays will have the same hash-code.
String[] example1 = {"a", "b", "c"}; // Hash: 126145
String[] example2 = {"a", "b", "c"}; // Hash: 126145
// These arrays will NOT have the same hash-code.
String[] example1 = {"a", "b", "c"}; // Hash: 126145
String[] example2 = {"aa", "b", "c"}; // Hash: 3015872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment