if I want to convert a string into an int in java
do you know if there is a way for me to detect overflow?
by that I mean the string literal actually represents a value whic
Cast String value to Long and compare Long value with Integer.Max_value
String bigStrVal="3147483647";
Long val=Long.parseLong(bigStrVal);
if (val>Integer.MAX_VALUE){
System.out.println("String value > Integer.Max_Value");
}else
System.out.println("String value < Integer.Max_Value");