Skip to content

Instantly share code, notes, and snippets.

@tarot
Last active October 26, 2017 08:48
Show Gist options
  • Save tarot/55e00d2c982511cdef380cfa16be9c83 to your computer and use it in GitHub Desktop.
Save tarot/55e00d2c982511cdef380cfa16be9c83 to your computer and use it in GitHub Desktop.
Object a = 'あ';
Object b = 'ア';
System.assertEquals(true, a == b); // ←わかる
System.assertEquals(false, a.equals(b)); // => Assertion Failed ←は?
// Solution
System.assertEquals(false, ((String) a).equals(b));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment