What is unreachable code and how might using multiple catch blocks cause this? Provide an example.
What will be an ideal response?
When you list multiple catch blocks following a try block, you must be careful that some catch blocks don't become unreachable. Unreachable statements are program statements that can never execute under any circumstances. For example, if two successive catch blocks catch an ArithmeticException and an ordinary Exception, respectively, the ArithmeticException errors cause the first catch to execute and other types that derive from Exception"fall through" to the more general Exceptioncatch block. However, if you reverse the sequence of the catch blocks so the one that catches general Exception objects is first, even ArithmeticExceptions would be caught by the Exception catch. The ArithmeticExceptioncatch block therefore is unreachable because the Exceptioncatch block is in its way and the class does not compile.
You might also like to view...
A(n) __________ is an action that takes place in an application, such as the clicking of a button.
a. instance b. effect c . case d. event
After the system is installed, it must be ________, meaning that the computer programs must be modified and kept up to date.
A) maintained B) replaced C) replicated D) CASE'd
If the Action Catalog is not visible on the right, you can ________ between showing or hiding it by clicking the Action Catalog button in the Show/Hide group located on the right of the Design tab
A) drag B) move C) drop D) toggle
Group managers said it was OK for their people to attend a three-day JAD session next week. Send a message to the JAD team members, with a brief explanation of JAD methods and a proposed agenda.
What will be an ideal response?