1. Hi, I need to read the input from the user and use Long.parseLong() to parse it to long datatype.
However, before parsing, I wish to check whether the user has entered the value greater than the max value of long (2^63-1) or smaller than min value of long(-2^63), how to do this?
2. The same question go to BigDecimal. By the way, what is the max and min value for BigDecimal?
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.