Return to site

JAVA CERTIFICATION QUESTION: The hierarchy of Java exception handlers

· java,ocp

When you have multiple catch statements on a single try, which catch goes first? Which goes last?

Given the code:

Which statement is correct? Choose one.

A. Compilation fails because the catch clause in line n2 makes the BarException handler unreachable.

B. Compilation fails because the Exception handler in line n3 is unreachable.

C. Compilation fails because the print statement in line n1 is unreachable.

D. Compilation succeeds.

 

 

 

 

·ꓷ uoᴉʇdo sᴉ ɹǝʍsuɐ ʇɔǝɹɹoɔ ǝɥꓕ ·uoᴉsnʅɔuoꓛ