OOPS

Exception v/s Error

Exception Can be handled.
Error No solutions to a problem.

Error

Examples:

Exception Handling

Examples:

  1. Something which is checked (or already known) to handle that situation.

Can be handled by self & so is checked.

  1. Unchecked + Errors

Checked, but cannot be handled by self.

Compile - Time Exception

a.k.a. “Checked Exception”

Compiler / Interpreter knows. Also, the programmer knows how to handle it.

Runtime Exception

a.k.a. “Unchecked Exception”

These are unchecked but still resolved only by the programmer’s help. Only some exceptions can be handled with the help of compiler.

5 Keywords

There are 5 keywords for exception handling in most programming languages.

We cannot try without catch. We cannot catch without try.

Exception Chaining