Integer 클래스의 MAX_VALUE 상수를 사용하면 int의 최대값인 2,147,483,647을 얻을 수 있다.
static int Integer.MAX_VALUE
Integer 클래스의 MIN_VALUE 상수를 사용하면 int의 최소값인 -2,147,483,648을 얻을 수 있다.
static int Integer.MIN_VALUE
public class MinMaxInteger {
public static void main(String[] args) {
System.out.println(Integer.MIN_VALUE); // -2147483648
System.out.println(Integer.MAX_VALUE); // 2147483647
}}