The Java int type is also used to store a signed whole number. The Java language
strictly defines the size of the int type as 32 bits (including a sign bit), yielding a
range of -2,147,483,648 through 2,147,483,647.
The int type in C is used to store a signed whole number value. The exact size of
the int type is specified by the compiler, but in general the int type is 16 bits
(including a sign bit), yielding a range of -32,768 through 32,767.
The C and C++ languages define a set of type modifiers, which have an effect on
the way the compiler stores an int value. The long modifier usually forces the
compiler to use 32 bits to represent an int, and the short modifier usually forces
the compiler to use 16 bits to represent an int. C also defines the signed and
unsigned modifiers, which have no counterpart in the Java language; Java integers
are always signed values.
The Java long type is used to store a signed whole number using 64 bits (including
a sign bit), yielding a range of -9,223,372,036,854,775,808 through
9,223,372,036,854,775,807. The Java short type is used to store a signed whole
number using 16 bits (including a sign bit), yielding a range of -32,768 through
32,767. The Java language also defines the byte type, which is used to store a
signed whole number using 8 bits (including a sign bit), yielding a range of -128
through 127.