satellite03
IS-IT--Management
hi, i am testing this code
output is 0. why?
but, if i test
its giving -128 . why ?
i know byte has range max=127 and min = -128 .
but using this two, i find the above two results are contradictory. both the cases results are out of range...but they are printing different results. why?
Code:
byte x =64,y;
y = (byte)(x<<2);
System.out.println(y);
but, if i test
Code:
byte x =64,y;
y = (byte)(x<<1);
System.out.println(y);
i know byte has range max=127 and min = -128 .
but using this two, i find the above two results are contradictory. both the cases results are out of range...but they are printing different results. why?