xxxxxxxxxx
There are mainly two types of exceptions in Java as follows:
1. Checked exception.
2. Unchecked exception.
xxxxxxxxxx
An exception is an event, which occurs during the execution of a
program, that disrupts the normal flow of the program's instructions.
xxxxxxxxxx
In java exception is an object. Exceptions are created when an abnormal
situations are arised in our program. Exceptions can be created by JVM or
by our application code. All Exception classes are defined in java.lang.
In otherwords we can say Exception as run time error.
xxxxxxxxxx
Exception is an abnormal condition.
There are mainly two types of exceptions: checked and unchecked.
An error is considered as the unchecked exception. However, according to Oracle,
there are three types of exceptions namely:
1. Checked Exception
2. Unchecked Exception
3. Error
xxxxxxxxxx
// There are numerous built-in exceptions in Java, such as the following:
// AclNotFoundException, ActivationException, AlreadyBoundException, ApplicationException,
// AWTException, BackingStoreException, BadAttributeValueExpException,
// BadBinaryOpValueExpException, BadLocationException, BadStringOperationException,
// BrokenBarrierException, CertificateException, CloneNotSupportedException,
// DataFormatException, DatatypeConfigurationException, DestroyFailedException,
// ExecutionException, ExpandVetoException, FontFormatException, GeneralSecurityException,
// GSSException, IllegalClassFormatException, InterruptedException, IntrospectionException,
// InvalidApplicationException, InvalidMidiDataException, and many more.
//
// Please see https://docs.oracle.com/javase/7/docs/api/java/lang/Exception.html for detailed examples