Which of the following are events that a programmer would want to throw an exception to manage?
a. A power failure (presumably in the absence of a UPS -- an Uninterruptable Power Supply).
b. A user enters a name too long for the C-string buffer, threatening a buffer overflow.
c. A disk drive fails
d. Operator new fails to find sufficient memory in the free store to satisfy a call.
e. Someone inadvertently presses the reset button on the front of the machine.
Parts b) and d) are situations that the exception facility was designed to manage.
Explanation: The exception facility was designed to manage unusual but predictable events, not unpredictable events such as power failure, hardware failure or someone pressing reset.
You might also like to view...
For the address 192.86.26.97/29, what is the binary conversion of the broadcast address?
A) 11000000 01010110 00011010 01100000 B) 11000000 01010110 00011010 01101111 C) 11000000 01010110 00011010 01100111 D) 11000000 01010110 00011010 01101000
What is the composition of a cryptographic key, whether symmetric or asymmetric?
A. A signed object B. A complex mathematical formula C. A binary value D. A prime number