Exercises
-
H.15 (Exceptional Conditions) List the various exceptional conditions that have occurred in programs throughout the appendices so far. List as many additional exceptional conditions as you can. For each of these, describe briefly how a program typically would handle the exception by using the exception-handling techniques discussed in this appendix. Typical exceptions include division by zero and array index out of bounds.
-
H.16 (Exceptions and Constructor Failure) Until this appendix, we’ve found dealing with errors detected by constructors to be a bit awkward. Explain why exception handling is an effective means for dealing with constructor failure.
-
H.17 (Catching Exceptions with Superclasses) Use inheritance to create an exception ...
Get Android How to Program, 3/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.