The finally keyword is used to create a block of code that follows a try block. A finally block of code always executes, whether or not an exception has occurred.