June 2018
Beginner
722 pages
18h 47m
English
Exceptions are classes that represent events that happen during program execution and disrupt the normal execution flow. We have already seen examples of NullPointerException, ClassCastException, and ArrayIndexOutOfBoundsException generated under the corresponding conditions.
All the exception classes in Java have a common parent, the java.lang.Exception class, which in turn extends the java.lang.Throwable class. That's why all exception objects have common behaviors. They contain information about the cause of the exceptional condition and the location of its origination (line number of the class source code).
Each exception can be thrown either automatically (by JVM) or by the application code using the
Read now
Unlock full access