Which three are advantages of the Java exception mechanism?

Which three are advantages of the Java exception mechanism?

Which three are advantages of the Java exception mechanism?

A.
Improves the program structure because the error handling code is separated from the normal program function

B.
Provides a set of standard exceptions that covers all the possible errors

C.
Improves the program structure because the programmer can choose where to handle exceptions

D.
Improves the program structure because exceptions must be handled in the method in which they occurred

E.
allows the creation of new exceptions that are tailored to the particular program being

Explanation:
A: The error handling is separated from the normal program logic.
C: You have some choice where to handle the exceptions.
E: You can create your own exceptions.
Incorrect answers:
B: The standard exceptions do not cover all possible errors. D. Exceptions do not need to be handled in the method where they occurred. They can be handled in the method which is calling the method that throws an exception.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Jazz

Jazz

A,C,E

Incorrect

B: Exceptions that covers all the possible errors – false
D: Exceptions must be handled in the method in which they occurred- false

James

James

The Answer is A, C, E.