Yes, up to the max value for the
short data type. Then you have to use
int up until you reach its max value. Then you have to use
long.
|
Code:
|
System.out.printf("max short value = %d%n" +
"max int value = %d%n" +
"max long value = %d%n",
Short.MAX_VALUE, Integer.MAX_VALUE,
Long.MAX_VALUE); |