The integer data types

There are four different integer data types in Java with the only difference that they differ in number of bits, and these are:

When typing a number in java code it’s assumed to be of type 32-bit integer. If it’s supposed to be of type long that has to be explicitly marked by an L or l.

Each of the integer types has a corresponding wrapper class with the same name as the data type except it is capitalized. These are not considered to be primitive datatypes. Instead they are like all other objects treated as reference data types.

These classes are for example helpful when wanting to convert between numbers and strings.

Search for more Java info on this site here:
Custom Search

Please type any questions here.