Java Integer MIN_VALUE Field
Example
Print the smallest int value, and see what happens when you subtract 1:
public class Main {
public static void main(String[] args) {
int myNum = Integer.MIN_VALUE;
System.out.println(myNum);
System.out.println(myNum - 1);
}
}
Definition and Usage
The MIN_VALUE field is a constant (a fixed value) that holds the smallest value an int can have: -2147483648.
If a calculation goes below this value, the result wraps around to the largest value. This is called an overflow.
Tip: Use MAX_VALUE to get the largest value an int can have.
Syntax
public static final int MIN_VALUE
Related Pages
❮ Integer Methods