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.
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.