Throwing an exception and catching an exception


Question 1: What is the difference between throwing an exception and catching an exception?

Question 2: How does a method declare that it can throw an exception? How does it actually throw an exception? Use Java code to illustrate your answer.

Question 3: Explain the difference between a checked exception and an unchecked exception.

Question 4: What happens if an exception does not have a matching catch block?

Question 5: What can a catch block do with the exception object that it receives?

Question 6: What is the purpose of the finally block?

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Throwing an exception and catching an exception
Reference No:- TGS0535376

Expected delivery within 24 Hours