What is Integer.MIN_VALUE in Java?

What are integers?

Integers are numbers that can be written without a fractional component. For example, 100, 200, 423, and 123 are integers, while 8.32, 5+1/2, -23.2 are not.

In Java, integers are represented in two’s complement binary form, with each number taking up 32 bits. We can encode that many values in 32 bits of space, where one bit represents the sign.

Integer.MIN_VALUE

The Integer.MIN_VALUE is a constant in the Integer class that represents the minimum or least integer value that can be represented in 32 bits, which is -2147483648, -231. This is the lowest value that any integer variable in Java can hold.

public class Main {
public static void main(String[] args){
System.out.println("Integer.MIN_VALUE= "+ Integer.MIN_VALUE);
}
}

Any value less than Integer.MIN_VALUE will lead to an overflow in memory and will be a positive value.

public class Main {
public static void main(String[] args){
System.out.println("(Integer.MIN_VALUE-1)= "+ (Integer.MIN_VALUE-1));
}
}
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources