All About Class NumberFormatException in Java



NumberFormatException is thrown from an application to indicate that the application has attempted to convert a String to one of the numeric types but the String does not have appropriate format. so this exception occurs when we try to convert an invalid String to number or vice versa. This is mostly thrown by classes of System package.

The Structure of the NumberFormatException class is given below:


public class java.lang.NumberFormatException extends java.lang.IllegalArgumentException{
//constructor
public NumberFormatException();
//constructs an empty NumberFormatException object that is an object with no message specified.
public NumberFormatException(String message);
//constructs an NumberFormatException object with the message specified.

}
 
All About Class NumberFormatException in Java All About Class NumberFormatException in Java Reviewed by Animesh Chatterjee on September 18, 2018 Rating: 5

No comments:

Powered by Blogger.