public static int parseInt( String s ) public static int parseInt( String s, int radix )
Integer.parseInt() throws a NumberFormatException if the input String contains any nonnumeric characters.
public class MainClass { public static void main(String[] argv) {
System.out.println(Integer.parseInt("asdf"));
}
}
Exception in thread "main" java.lang.NumberFormatException: For input string: "asdf"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.parseInt(Integer.java:497)
at MainClass.main(MainClass.java:3)