- 1
storing the values
which type of variable used to store the value 654644
4 odpowiedzi
+ 1
if you just want to store it , String can help you too.
+ 6
According to the following reference, int and any type greater than int can hold this number
+---------+------+-------+-------+
| types | size | min | max. |
| | (bits) | value | value |
+---------+------+-------+-------+
| byte | 8 | -128 | 127 |
+---------+------+-------+-------+
| char | 16 | 0 | 2^16 |
| | | | - 1 |
+---------+------+-------+-------+
| short | 16 | -2^15 | 2^15 |
| | | | - 1 |
+---------+------+-------+-------+
| int | 32 | -2^31 | 2^31 |
| | | | - 1 |
+---------+------+-------+-------+
| long | 64 | -2^63 | 2^63 |
| | | | - 1 |
+---------+------+-------+-------+
| float | 32 | 2^ | (2 - 2^ |
| | | -148 | -23) * |
| | | | 2^127 |
+---------+------+-------+-------+
| double | 64 | 2^ | (2 - 2^ |
| | | -1074 | -52) * |
| | | | 2^1023|
+---------+------+-------+-------+
| boolean | 1 | -- | -- |
+---------+------+-------+-------+
| void | -- | -- | -- |
+---------+------+-------+-------+
+ 1
int64
+ 1
654644 is an Integer type value, because it's higher than Short.MAX_VALUE and lower than Integer.MAX_VALUE. So you should use int or long.