Java MCQ: Exception created by try block is caught in which block?
a) catch
b) throw
c) finally
d) finalize
Answer:
a) catch
Explanation:
In Java, exceptions that are thrown within a try
block are caught and handled by the corresponding catch
block. The catch
block allows you to define a response to the specific type of exception that was thrown.
Reference links:
https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html