The maximum and minimum values of primitive number types in Java (Byte
, Short
, Integer
, Long
, Float
, Double
) can be obtained by reading the MAX_VALUE
and MIN_VALUE
of their classes.
For example:
int maxInt = Integer.MAX_VALUE;
float minFloat = Float.MIN_VALUE;