In Java, we have 3 exception handlers: try, catch and finally, to catch and handle the exception. Along with these handlers, one more handler try-with-resources has been introduced in Java 7.
Lets see how to use these exception handlers.
Consider the following example which copies a file from source to destination: