Going through some practice questions, one is very vague.
If a method throws an unchecked exception does code need to be added for it to compile and execute?
Wouldn't the answer depend on the definition of execute? Execute until the exception or execute successfully.
The above code would not execute successfully, only printing 1.
The above code would execute successfully, print 13.
So for the code to compile and execute, the code which could throw an unchecked exception would have to be in a try block of a try/catch. In the example above if the method was to declare the ArithmeticException in the method header the rest of the method would not execute.