Câu 79: GSSP-Java: GIAC Secure Software Programmer-Java
Wilbert works as a Software Developer for Wintos Inc. He writes the following code.1. public class tcf2. {3. public static void main(String[] args)4. {5. try6. {7. int x = 5 / 0;8. System.exit(0);9. }10. catch(ArithmeticException e)11. {12. System.out.println("Within catch");13. }14. finally15. {16. System.out.println…
Nội dung câu hỏi
Wilbert works as a Software Developer for Wintos Inc. He writes the following code.1. public class tcf2. {3. public static void main(String[] args)4. {5. try6. {7. int x = 5 / 0;8. System.exit(0);9. }10. catch(ArithmeticException e)11. {12. System.out.println("Within catch");13. }14. finally15. {16. System.out.println("Within finally");17. }18. }19. }What will happen when he tries to compile and execute the code?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. It will compile and print Within catch as the output.
- B. It will compile and execute successfully but will not print anything.
- C. It will compile and print Within catch and Within finally as the output. — đáp án hiện tại
- D. It will compile and print Within finally as the output.
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.