49is the ASCII char value 1. This is the value of the first byte.
The byte stream that is created when you type 1 0 Enteron your console or terminal contains three bytes {49,48,10}(on my Mac, it may end 10, 12 or 12 instead of 10, depending on your system).
So, the conclusion of a simple fragment
int b = System.in.read();
while (b != -1) {
System.out.println(b);
b = System.in.read();
}
after entering 10 and entering input, there is (on my machine)
49
48
10
source
share