정수 최대값, 최소값
| 최대값 | 최소값 |
| 231-1 (2,147,483,647) | -231 (-2,147,483,648) |
Integer 클래스
- int의 Wrapper 클래스인 Integer 클래스 통해 정수의 최대값, 최소값 구할 수 있음
static int Integer.MAX_VALUE
static int Integer.MIN_VALUE
예제
public class IntegerMaxMin {
public static void main(String[] args) {
System.out.println(Integer.MAX_VALUE); //2147483647
System.out.println(Integer.MIN_VALUE); //-2147483648
}
}
'Backend > Java' 카테고리의 다른 글
| [자바의 신] 16장 (0) | 2022.07.25 |
|---|---|
| [Java] String ➡ Long 타입으로 형변환 (0) | 2022.03.30 |
| [Java] int와 Integer 비교 (0) | 2022.03.21 |
| [Error] java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener (0) | 2022.02.28 |
| [Java] instanceof : 객체 타입 비교 (0) | 2022.02.21 |
댓글