PPT Slide
?The method equals returns true if it is
passed a reference to a String object with the
same contents as a given String.
?The method equalsIgnoreCase works like
equals, but ignores upper/lower case distinctions.
? The method compareTo returns an int that is
less than, equal to, or greater than zero for
Example: Part of a Binary Search
int mid = lo + (hi - lo) / 2;
int cmp = key.compareTo(table[mid]);
if (cmp == 0) return mid;
else if (cmp < 0) hi = mid - 1;