Try catch block can be used to continue your program when an error occurs. You put the code you want to test for errors in the try block. If there is an error in the try block then the catch block will run. The finally block will run no matter if there is an error or not.