Chapter 12: Problem 18
If a method has a throw statement, does it always have to have a throws clause in its header? Why or why not?
Short Answer
Expert verified
Short Answer: A method containing a throw statement does not always need to have a throws clause in its header, as it depends on whether the exception is checked or unchecked. If the exception is checked, a throws clause is required unless enclosed in a try-catch block, while it is not needed for unchecked exceptions.