Question

Which of the following correctly handles multiple exceptions in Java?

A Writing separate try blocks for each exception.
B Using multiple catch blocks for different exceptions in a single try block.
C Nesting try blocks within each other to handle different exceptions.
D Using a single catch block for all exceptions, regardless of their type.
E Writing the exception type as a string in the catch block.
Practice Next

Hey! Ask a query