public class helloworldgenekim {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 263;
System.out.println(a);
byte b = (byte) a;
System.out.println(b);
}
}
byte 가 127 까지밖에 안되는건 알고있는데 저렇게 형변환했는데 263이 왜 7이되는거임?
public class helloworldgenekim {
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 263;
System.out.println(a);
byte b = (byte) a;
System.out.println(b);
}
}
127 -> 0 -> 127 -> 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7
자린이임 말로 설명해줘 ㅠ
-128 ~ 127, 128이 들어오면 -128임
죽어
갑분살 - dc App
오버플로우 일어난거임 - dc App
263을 128로 나눠보면 나머지가 몇나올까요~? - dc App
263/128=2
몫말고시발 - dc App