In C, the language itself does not determine the representation of certain datatypes. It can vary from machine to machine, on embedded systems the int can be 16 bit wide, though usually it is 32 bit.

The only requirement is that short int <= int <= long int by size. Also, there is a recommendation that int should represent the native capacity of the processor.

All types are signed. The unsigned modifier allows you to use the highest bit as part of the value (otherwise it is reserved for the sign bit).

Here's a short table of the possible values for the possible data types:

          width                     minimum                         maximum
signed    8 bit                        -128                            +127
signed   16 bit                     -32 768                         +32 767
signed   32 bit              -2 147 483 648                  +2 147 483 647
signed   64 bit  -9 223 372 036 854 775 808      +9 223 372 036 854 775 807
unsigned  8 bit                           0                            +255
unsigned 16 bit                           0                         +65 535
unsigned 32 bit                           0                  +4 294 967 295
unsigned 64 bit                           0     +18 446 744 073 709 551 615

In Java, the Java Language Specification determines the representation of the data types.

The order is: byte 8 bits, short 16 bits, int 32 bits, long 64 bits. All of these types are signed, there are no unsigned versions. However, bit manipulations treat the numbers as they were unsigned (that is, handling all bits correctly).

The character data type char is 16 bits wide, unsigned, and holds characters using UTF-16 encoding (however, it is possible to assign a char an arbitrary unsigned 16 bit integer that represents an invalid character codepoint)

          width                     minimum                         maximum

SIGNED
byte:     8 bit                        -128                            +127
short:   16 bit                     -32 768                         +32 767
int:     32 bit              -2 147 483 648                  +2 147 483 647
long:    64 bit  -9 223 372 036 854 775 808      +9 223 372 036 854 775 807

UNSIGNED
char     16 bit                           0                         +65 535
Answer from gaborsch on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › java › integer-max_value-and-integer-min_value-in-java-with-examples
Integer.MAX_VALUE and Integer.MIN_VALUE in Java with Examples - GeeksforGeeks
July 12, 2025 - // Java program to show // the ... System.out.println("Integer.MAX_VALUE = " + Integer.MAX_VALUE); } } ... Integer.MAX_VALUE = 2147483647 Any integer variable cannot store any value beyond this limit....
🌐
CodeGym
codegym.cc › java blog › java numbers › integer max_value in java with examples
Integer MAX_VALUE in Java with Examples
December 10, 2024 - Thus, there are 2^31-1 possible values. Hence, there is no integer greater than the number 2^31-1 in Java. It is used to automatically assign any variable the maximum integer possible without requiring to remember the exact number.
🌐
TutorialsPoint
tutorialspoint.com › integer-max-value-and-integer-min-value-in-java-with-examples
Integer.MAX_VALUE and Integer.MIN_VALUE in Java with Examples
In the end, print the results and exit. public class Example2 { public static void main(String[] args) { // initializing an array of integers int[] numericList = {10, -5, 3, 7, 15}; // storing the minimum and maximum values int smlst = Integer.MAX_VALUE; int lrgst = Integer.MIN_VALUE; // to ...
Top answer
1 of 11
450

In C, the language itself does not determine the representation of certain datatypes. It can vary from machine to machine, on embedded systems the int can be 16 bit wide, though usually it is 32 bit.

The only requirement is that short int <= int <= long int by size. Also, there is a recommendation that int should represent the native capacity of the processor.

All types are signed. The unsigned modifier allows you to use the highest bit as part of the value (otherwise it is reserved for the sign bit).

Here's a short table of the possible values for the possible data types:

          width                     minimum                         maximum
signed    8 bit                        -128                            +127
signed   16 bit                     -32 768                         +32 767
signed   32 bit              -2 147 483 648                  +2 147 483 647
signed   64 bit  -9 223 372 036 854 775 808      +9 223 372 036 854 775 807
unsigned  8 bit                           0                            +255
unsigned 16 bit                           0                         +65 535
unsigned 32 bit                           0                  +4 294 967 295
unsigned 64 bit                           0     +18 446 744 073 709 551 615

In Java, the Java Language Specification determines the representation of the data types.

The order is: byte 8 bits, short 16 bits, int 32 bits, long 64 bits. All of these types are signed, there are no unsigned versions. However, bit manipulations treat the numbers as they were unsigned (that is, handling all bits correctly).

The character data type char is 16 bits wide, unsigned, and holds characters using UTF-16 encoding (however, it is possible to assign a char an arbitrary unsigned 16 bit integer that represents an invalid character codepoint)

          width                     minimum                         maximum

SIGNED
byte:     8 bit                        -128                            +127
short:   16 bit                     -32 768                         +32 767
int:     32 bit              -2 147 483 648                  +2 147 483 647
long:    64 bit  -9 223 372 036 854 775 808      +9 223 372 036 854 775 807

UNSIGNED
char     16 bit                           0                         +65 535
2 of 11
84

In C, the integer(for 32 bit machine) is 32 bit and it ranges from -32768 to +32767.

Wrong. 32-bit signed integer in 2's complement representation has the range -231 to 231-1 which is equal to -2,147,483,648 to 2,147,483,647.

🌐
W3Docs
w3docs.com › java
max value of integer
If you need to store numbers that ... of an int, you can use the long type, which has a minimum value of -9223372036854775808 and a maximum value of 9223372036854775807. You can use the Long.MAX_VALUE and Long.MIN_VALUE constants to get the ...
🌐
iO Flood
ioflood.com › blog › integer-max-value-java
Java's Integer.MAX_VALUE Explained: A Complete Guide
March 11, 2024 - In Java, The Integer.MAX_VALUE function returns the maximum value that an integer can have. This value is 2,147,483,647 which is the same as 2^31 – 1. ... In this example, we declare an integer max and assign it the value of Integer.MAX_VALUE.
🌐
Tutorialspoint
tutorialspoint.com › home › java/lang › java math.max() method
Math max(int x, int y) Method - Java
September 1, 2008 - This method returns the larger ... MathDemo { public static void main(String[] args) { // get two int numbers int x = 60984; int y = 497; // call max and print the result System.out.println("Math.max(" + x + "," + y + ")=" ...
🌐
Java Code Geeks
examples.javacodegeeks.com › home › java development › core java
Java Max Int Example - Java Code Geeks
June 15, 2020 - This section explains why the integer variable has max value 2^31-1 and min value -2^31. Java stores integer sign numbers in bits with two’s complement representation.
Find elsewhere
🌐
Delft Stack
delftstack.com › home › howto › java › max value of integer in java
The Max Value of an Integer in Java | Delft Stack
March 11, 2025 - One of the simplest ways to find the maximum value of an integer in Java is by utilizing the built-in constant Integer.MAX_VALUE. This constant represents the maximum value that an integer can hold, which is 2,147,483,647.
🌐
Educative
educative.io › answers › what-is-integermaxvalue
What is Integer.MAX_VALUE?
Integer.MAX_VALUE represents the maximum positive integer value that can be represented in 32 bits (i.e., 2147483647). This means that no number of type Integer that is greater than 2147483647 can exist in Java.
🌐
Vultr Docs
docs.vultr.com › java › standard-library › java › lang › Math › max
Java Math max() - Find Maximum Value | Vultr Docs
December 3, 2024 - Scanner scanner = new Scanner(System.in); System.out.print("Enter first number: "); int firstNum = scanner.nextInt(); System.out.print("Enter second number: "); int secondNum = scanner.nextInt(); int result = Math.max(firstNum, secondNum); ...
🌐
TutorialsPoint
tutorialspoint.com › what-is-the-maximum-possible-value-of-an-integer-in-java
What is the maximum possible value of an integer in Java ?
The type is int The size is 32 The max value of integer is 2147483647 · A class named Demo uses the Integer class and gives the various characteristics of the Integer class such as type, size and max_value. The maximum value that an integer can hold can be computed by calling the integer class with the MAX_VALUE value.
🌐
Runestone Academy
runestone.academy › ns › books › published › apcsareview › VariableBasics › minAndMax.html
3.7. Integer Min and Max — AP CSA Java Review - Obsolete
Integers in Java are represented in 2’s complement binary and each integer gets 32 bits of space. In 32 bits of space with one bit used to represent the sign you can represent that many values. Why is there one more negative number than positive number? It is because 0 is considered a positive number. What do the last two lines print out? Did this surprise you? Java will actually return the maximum integer value if you try to subtract one from the minimum value.
🌐
Scaler
scaler.com › home › topics › max function in java
Max Function in Java - Scaler Topics
April 20, 2024 - In the below example, we are iterating on the elements of the given array. Using the Math.max() method, we are finding the maximum value and updating the max value in the 'maxValue' variable. In the starting, we initialized the maxValue variable to Integer.MIN_VALUE because Integer.MIN_VALUE is the smallest value that can be present in an integer array.
🌐
W3Schools
w3schools.com › java › ref_math_max.asp
Java Math max() Method
System.out.println(Math.max(2.0, 0.25)); System.out.println(Math.max(31.2f, 18.0f)); System.out.println(Math.max(14, 22)); System.out.println(Math.max(96L, 2048L)); ... The max() method returns the number with the highest value from a pair of ...
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › lang › Integer.html
Integer (Java Platform SE 8 )
October 20, 2025 - A constant holding the minimum value an int can have, -231. ... A constant holding the maximum value an int can have, 231-1.
🌐
Tutorial Gateway
tutorialgateway.org › java-max-function
Java max Function
March 28, 2025 - In this example, First, We used the Function directly on both the Positive int or integer and negative integer values. The first three systems out println statements will call the integer type ( static int max(integer a, integer b) ) method and find the largest among the values. Here, we used the Java Math.max Function on variables b, c, d, and e (they belong to double type).
🌐
JanBask Training
janbasktraining.com › community › java › max-value-of-integer
max value of integer | JanBask Training Community
April 1, 2025 - BigInt: No fixed limit, similar to Python’s int. ... Overflow Issues – Exceeding the max value can cause unexpected behavior in some languages. Performance Considerations – Larger numbers consume more memory and processing power. Choosing the Right Type – Always select a data type that fits your needs without wasting resources. If you’re working with numbers beyond these limits, consider using BigInt (JavaScript), BigInteger (Java), or arbitrary precision integers (Python).