Exceptions - Study Mode

[#61] What is the purpose of the "catch" block in exception handling?
Correct Answer

(C) It catches exceptions and handles them

[#62] In Java, can a "catch" block catch multiple exceptions?
Correct Answer

(D) Yes, a "catch" block can catch multiple exceptions using the pipe ( | ) symbol

[#63] What is the purpose of the "throw" keyword in Java exception handling?
Correct Answer

(A) To explicitly throw an exception

[#64] In Java, can a method throw any checked exception without declaring it using "throws"?
Correct Answer

(D) Yes, a method can throw any checked exception without declaration

[#65] What is the purpose of the "throws" keyword in Java method declaration?
Correct Answer

(C) To indicate that the method may throw a checked exception