GIAC
GSSP-JAVA · Question #51
GSSP-JAVA Question #51: Real Exam Question with Answer & Explanation
Sign in or unlock GSSP-JAVA to reveal the answer and full explanation for question #51. The question stem and answer options stay visible for context.
Question
Sam works as a Software Developer for Gentech Inc. He writes the following code. 1. class TryFinallyTest { 2. public static void main(String[] args) { 3. try { 4. int i=15/0; 5. System.out.println("Testing Try"); 6. } 7. catch(ArithmeticException ae) { 8. System.out.println("Arithmetic exception"); 9. } 10. System.out.println("Correct"); 11. finally { 12. System.out.println("Must execute"); 13. } 14. } 15. } What will happen when he attempts to compile and execute the code?
Options
- AIt will compile successfully and run with output Arithmetic exception.
- BIt will compile successfully and run with output Must execute.
- CIt will compile successfully and run with output Correct.
- DIt will give a compile-time error.
Unlock GSSP-JAVA to see the answer
You've previewed enough free GSSP-JAVA questions. Unlock GSSP-JAVA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.