...

/

Exception Handling with try

Exception Handling with try

This lesson introduces the try control structure and teaches you how it can be used for exception handling.

Exception Handling

When running a program, we sometimes encounter unexpected conditions which give us errors and warnings. These conditions are known as exceptions. While exceptions are unexpected, they need to be anticipated by the programmer and only then can they be dealt with in a timely manner. The process of skillfully handling exceptions is known as exception handling.

Let’s take a real-life example to better visualize exception handling.

Imagine ...

svg viewer