QUESTION:-
When do numeric wrapper class constructor raise NumberFormatException?
Answers
Answered by
5
Answer-:
The NumberFormatException is thrown when we try to convert a string into a numeric value such as float or integer, but the format of the input string is not appropriate or illegal. By illegal format, it is meant that if you are trying to parse a string to an integer but the String contains a boolean value, it is of illegal format.
For example - if we try to parse a string to integer but the string is null.
It is an unchecked exception.
Similar questions