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.
%d
int
-100
You can also use %x for hexadecimal.
%x
You could use
%d
for decimal output (works for all integer types, not justint
), but this will print the signed value (such as-100
), which can be unexpected for a byte.You can also use
%x
for hexadecimal.