Java Reference
In-Depth Information
exactly the same reason, something that the designers of the rocket had not
expected. They figured that the devices might fail for mechanical reasons, and the
chances of two devices having the same mechanical failure was considered remote.
At that point, the rocket was without reliable position information and went off
course.
Perhaps it would have been better if the software hadn't been so thorough? If it had
ignored the overflow, the device wouldn't have been shut off. It would have
computed bad data. But then the device would have reported wrong position data,
which could have been just as fatal. Instead, a correct implementation should have
caught overflow exceptions and come up with some strategy to recompute the
flight data. Clearly, giving up was not a reasonable option in this context.
The Explosion of the Ariane Rocket
520
521
The advantage of the exception-handling mechanism is that it makes these issues
explicit to programmersȌsomething to think about when you curse the Java
compiler for complaining about uncaught exceptions.
CHAPTER SUMMARY
1.
When reading text files, use the Scanner class.
2.
When writing text files, use the PrintWriter class and the
print/println methods.
3.
You must close all files when you are done processing them.
4.
The JFileChooser dialog box allows users to select a file by navigating
through directories.
Search WWH ::




Custom Search