[Java] long에서 int로 안전하게 형변환하기
long to int in Java intValue() 를 이용한 cast 1-1) Long to int (using intValue) 1-2) Nullsafe Long to int (using intValue) 1-3) long to int (using intValue) 1-4) intValue 이용시 발생되는 overflow 이슈 Math.toIntExtrac()를 이용한 cast 1. intValue() 를 이용한 cast 1-1) Long to int (using intValue) Long l1 = 11L; int i1 = l1.intValue(); System.out.println(l1 +", " +i1); 11, 11 Wrapper 클래스 Long의 intValue() 를 이용하여 int타입으..
2020. 5. 4. 11:16