Given following Java codes:
String columnValue = "188237574385834583453453635";
columnValue =(Long.parseLong(columnValue)>Long.MAX_VALUE?"0":columnValue);
It throws java.lang.NumberFormatException since the input value is beyond Long's maximum value. However, it there an easy way to detect whether a number in a 'string' type get out of Long's maximum value with out using try catch solution?
longvalue can be greater thanLong.MAX_VALUE, by definition.parseLongand instead of throwing an exception, return aboolean. Though, throwing the exception here makes sense, in my opinion.