-1

What's the format specifier of byte in Java?

For example,

%d=int

%s=short

%f=float 
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199

1 Answers1

0

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.

Thilo
  • 257,207
  • 101
  • 511
  • 656