Beware of using the System.in.
read() method. It doesn't do what you think it does. Always read the API documentation before using an unfamiliar method.
If you look at the link I posted, you see its return value is
int. It says "next byte" so it won't return anything over 0xff (255). If you use a keyboard with only ASCII keys, you get the ASCII equivalent of the keystroke, eg 0x34 for '4' (52 in decimal). Try casting those
ints to
chars, and printing them with the %c tag of a printf method. Then they will revert to the characters you thought they were.