title: How do I use the character's equals() method in Java?
body: <p>As the String is an object, you need to use the <code>string.equals(string)</code> method to confirm that the two strings are equal.</p>
  <p>However, why do you use the <code>==</code> to check if two chars are equal, <code>char1 == char2</code>, rather than <code>char1.equals(char2)</code>?</p>