The exception facility should be used when
a. Some resource is unavailable to the compiler
b. A program encounters an error and cannot recover, but needs to shut down gracefully, perhaps saving work..
c. A program requests a resource that is not available.
d. Array index value is out-of-bounds
e. A programmer calls the wrong function
f. A division by zero occurs
g. There is a compiler detected error
h) A call to operator new fails to allocate memory from free store
i) An arithmetic error occurs
All are correct except parts a). e) and g)
Explanation: Part a) is a compiler problem that has nothing to do with the program. Part e) is a logic error that the exception facility cannot help. Part g) is like part a).
Part b) is typical of a severe failure managed by exceptions. Part h) is an examples of part c). Part f) is a example of i).
You might also like to view...
A program with the set user id bit set will
A. change the username of the person running the program B. run with the effective user id of the owner of the program
A Datasheet form is similar to a table or query's Datasheet view
Indicate whether the statement is true or false
Which netstat option is for displaying all connections including listening ports?
a. -an b. -a c. -n d. None of the above
Answer the following statements true (T) or false (F)
1) By default, instance variables are not initialized. 2) Instance variables are required to be explicitly initialized before they’re used in a program. 3) Making a class’s instance variables public and its methods private and accessing those instance variables only through the class’s methods and properties facilitates debugging, because problems with data manipulations are localized to the methods (and properties). 4) An attempt by a method that’s not a member of a particular class to access a private member of that class is a runtime error.