Multiple choice technology

Given: 11. static void test() throws Error { 12. if (true) throw new AssertionError(); 13. System.out.print("test "); 14. } 15. public static void main(String[] args) { 16. try { test(); } 17. catch (Exception ex) { System.out.print("exception "); } 18. System.out.print("end "); 19. } What is the result?

  1. end

  2. compilation fails

  3. exception end

  4. exception test end

  5. A Throwable is thrown by main.

  6. An Exception is thrown by main.

Reveal answer Fill a bubble to check yourself
F Correct answer