11 Exception Handling


In Java, errors can be divided into two categories: compile time errors and runtime errors. Compile time errors are syntactic errors during writing of the program. Most common examples of compile time errors are missing semicolon, comma, double quotes, etc. They occur mainly due to poor understanding of language or lack of concentration in writing the program.

Logical errors occur mainly due to improper understanding of the program logic by the programmer. Logical errors cause the unexpected or unwanted output.

Exceptions are runtime errors which a programmer usually does not expect. They occur accidentally, which may result in abnormal termination of the program. Java provides exception handling mechanism, ...

Get Java Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.