If you follow the documentation, you find:
public void println(int x)
Prints an integer and then terminate the line. This method behaves as though it invokes
print(int)
and thenprintln()
.
Then the print(int)
documentation says:
The string produced by
String.valueOf(int
) is translated into bytes according to the platform’s default character encoding, and these bytes are written in exactly the manner of thewrite(int)
method.
So it converts the integer to a String before converting that to bytes and printing it out.