Question
Which of the following is used to handle exceptions in
Java?Solution
try-catch blocks in Java handle runtime exceptions. throw is used to explicitly throw an exception, while try-catch manages it.
Question
try-catch blocks in Java handle runtime exceptions. throw is used to explicitly throw an exception, while try-catch manages it.