Multiple choice

Exceptions can be thrown by

  1. the Java Virtual Machine

  2. code in a try block

  3. calls from a try block to other methods

  4. All of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Exceptions can be thrown by the JVM (e.g., NullPointerException), by explicit throw statements in code, or by methods called within a try block.