What is the output? try { int x = 5 / 0; } catch (Exception e) { System.out.print("Caught"); }

  1. Caught
  2. Exception
  3. Runtime Error
  4. Nothing
Correct answer Caught

Explanation

Division by zero causes ArithmeticException, which is caught.

Update: Admin added a tag on this question

Topics

By Admin · · 33 views