// What does it mean when it is equal to '-'?
Each letter and symbol are symbols. You can look at the first character of the string and check the match.
In this case, you will receive the first character and see if it is a minus symbol. This minus sign (char) 45 cm. Below
// How are char variables compared to the < operator?
In Java, all characters are actually 16-bit unsigned numbers. Each character has a number based on it unicode. for example, '9' is a character (char) 57 This comparison is true for any character smaller than the code for 9 , for example. space.

The first character of your string is 'a' , which is (char) 97 , so (char) 97 < (char) 57 is false.
Peter Lawrey
source share