A variety of errors can occur when executing Java code: coding errors made by the programmer, errors due to incorrect user input, or other unforeseen situations. In this lesson, we will focus on how to handle exceptions and how the program should react if an error occurs. When an error occurs, a Java program usually stops and displays an error message, however, we will learn how to change the behavior of the program and perform certain instructions using try, catch, finally operators.