Java Reference
In-Depth Information
11. To pass the exception message string to the RuntimeException
superclass.
12. Exception or IOException are both good choices. Because file
corruption is beyond the control of the programmer, this should be a
checked exception, so it would be wrong to extend RuntimeException .
13. It would not be able to do much with them. The DataSetReader class is
a reusable class that may be used for systems with different languages and
different user interfaces. Thus, it cannot engage in a dialog with the
program user.
14. DataAnalyzer.main calls DataSetReader.readFile , which
calls readData . The call in.hasNextInt() returns false , and
readData throws a BadDataException . The readFile method
doesn't catch it, so it propagates back to main , where it is caught.
527
Search WWH ::




Custom Search