1
int i;
byte b;

i = 1782;

b = (byte) i;

System.out.print(b);

Here I get -10 but cannot understand why. Please explain my how casts in Java work.

user16217248
  • 3,119
  • 19
  • 19
  • 37
Dr. March
  • 11
  • 1

0 Answers0