Java says a string has two characters, while your user sees exactly one. Both answers are correct, and that is the trap. The Bug Behind a Single Smiley Imagine a form that limits a nickname to ten characters. A user types ten emoji, yet your code rejects the input as too long. Alternatively, a truncation …