Skip to content

Instantly share code, notes, and snippets.

@aniketmlk6
Created June 30, 2021 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniketmlk6/c8c7cedf11111f7b0fc0ca614b528205 to your computer and use it in GitHub Desktop.
Save aniketmlk6/c8c7cedf11111f7b0fc0ca614b528205 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
Character char1 = new Character('a');
Character char2 = new Character('b');
int char1Code = Character.hashCode(char1);
int char2Code = Character.hashCode(char2);
if (char1Code==char2Code) {
System.out.println("the characters are same");
} else {
System.out.println("the characters are different");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment