Personal tools
You are here: Home Information Systems Java Platform Introduction Solutions Solution 7 B

Solution 7 B

Document Actions
  • Send this
  • Print this
  • Content View
  • Bookmarks

Solution 7 B

<-- Previous

Table of Contents

Next -->

The code above is the constructor for NewGreeter adjusted to handle a NullPointerException. Note that although it is actually the class TestNewGreeter that is normally responsible for executing the System.exit(0); instruction, when an exception is thrown the responsibility for terminating code execution safely passes to NewGreeter, because code execution will not be returned to TestNewGreeter after the exception is thrown.

<-- Previous

Table of Contents

Next -->

© G. Hearn, & University of the Western Cape, 2006

Copyright 2007-2008, by the Contributing Authors. Cite/attribute Resource. Solution 7 B. (2008, July 16). Retrieved May 26, 2013, from UWC Free Courseware Web site: http://free.uwc.ac.za/freecourseware/information-systems/java-platform-introduction/solutions/solution-7-b. This work is licensed under a Creative Commons License : Attribution-ShareAlike 3.0. Creative Commons License : Attribution-ShareAlike 3.0