i from API I receive next string:
String userId = "4463570100035744";
I need to convert it to int, so I tried next code:
try {
int id = Integer.parseInt(userId);
} catch (NumberFormatException e){
e.printStackTrace();
}
but I still catch exeption....
what can be the reason?
REASON: value is outside the range of an int
ACTION: You must use Long and not Integer .Use a long/Long instead.
Integer.MAX_VALUE = 2147483647
Integer.MIN_VALUE = -2147483648
Long.MAX_VALUE = 9223372036854775807
Long.MIN_VALUE = -9223372036854775808