Created
January 26, 2022 08:00
-
-
Save ntub46010/41d1f331b1cbc78cdbaa300b00658eb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean equals(Object anObject) { | |
if (this == anObject) { | |
return true; | |
} | |
if (anObject instanceof String) { | |
String aString = (String)anObject; | |
if (coder() == aString.coder()) { | |
return isLatin1() ? StringLatin1.equals(value, aString.value) | |
: StringUTF16.equals(value, aString.value); | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment