Number Format Exception
NumberFormatException is a subclass of the Runtime Exception class. A Number Format Exception occurs in the java code when a programmer tries to convert a String into a number. The Number might be int,float or any java numeric values.
Understand Number Format Exception
The conversions are done by the functions Integer.parseInt and Integer.parseDouble. Consider the function call Integer.parseInt(str) where str is a variable of type String. Suppose the value of str is "60", then the function call and convert the string into the int 60. However, if you give the value of str is "saurabh", the function call will fail to compile because "saurabh" is not a legal string representation of an int value. In such case, NumberFormatException will occurs