What's the format specifier of byte in Java?
For example,
%d=int
%s=short
%f=float
What's the format specifier of byte in Java?
For example,
%d=int
%s=short
%f=float
You could use %d
for decimal output (works for all integer types, not just int
), but this will print the signed value (such as -100
), which can be unexpected for a byte.
You can also use %x
for hexadecimal.