I notice that the following line of code exists a lot. (For example on this website.)
char ch = (char) System.in.read(); // uses a char, and requires a cast.
Now to test for a particular character keystroke, or an ASCII value, or an escape sequence, etc..
if (ch == 'a' || ch == 65 || ch == '\n' || ch == 13) System.out.print("true");
Does using a char above provide any benefits over the following line of code below, which uses an int?
int i = System.in.read(); // uses an int, which requires no cast.
The int variable "i" can be used in the same if statement as previously shown, above.