Catching and Handling Exceptions

By Raul Rios

The try Statement The try statement is used wherever there is code that could throw an exception. It involves the use of three reserved words: try, catch and finally. The syntax is the following:

The try statement must contain at least one catch block or one finally block. The ..Continue Reading


By Raul Rios

An exception is an event that disrupts the normal flow of execution in a program. Some of the advantages of using exceptions are: Separating error-handling code from regular code Easily differentiating error types Being able to propagate errors up the call stack For the exam, you should be familiar with the ..Continue Reading