Bifalgorithm post · Computer science one · Comparing Strings and Characters
How can comparison operators be used with characters in Java?
How can comparison operators be used with characters in Java? (Computer science one · Comparing Strings and Characters) — "The comparison operators in Table 27…
Ideas in this flowchart
- Comparison operators can be used with single characters in Java.
- The ASCII table associates each alphanumeric character, symbol, and whitespace character with an integer from 0 to 127.
- Character comparisons are determined by the ordering of their ASCII integer values.
- Uppercase letters are ordered before lowercase letters in the ASCII table.
- ('A' < 'a') is true because 'A' is 65, 'a' is 97, and 65 < 97.
- Additional character-comparison examples are shown in Table 27.4.
- ('A' == 'a') is false.
- ('A' < 'Z') is true.
- ('0' < '9') is true.
- ('\n' < 'A') is true.
- (' ' < '\n') is false.