233k views
3 votes
Unchecked exceptions require you surround the code that might throw such an exception with a try block or you must use a throws statement at the end of the method signature. Failure to do one of these two things will result in a compile error.

a. True
b. False

User Spazm
by
4.4k points

1 Answer

4 votes

Answer:

b. False

Step-by-step explanation:

False, unchecked exceptions do not cause compilation errors and do not require try/catch blocks or throws statements. However, although they are not required it is good programming to include them in order to handle any exceptions that may arise. If you do not include a proper way to handle such an exception the program will still run but may run into an exception during runtime. If this occurs then the entire program will crash because it does not know how to handle the exception since you did not provide instructions for such a scenario.

User Pramote Kuacharoen
by
3.4k points