When is the code within a catch block executed?

When is the code within a catch block executed?




a. When the exception specified in the catch block is thrown in the try block
b. When the try block finishes executing
c. When the code in the try block doesn't compile
d. When a runtime error occurs


Answer: a. When the exception specified in the catch block is thrown in the try block


Learn More :