Solutions to selected exercises can be found in the electronic document The Thinking in Java Annotated Solution Guide, available for a small fee from www.BruceEckel.com.
Open a text file so that you can read the file one line at a time. Read
each line as a String and place that String object into a
LinkedList. Print all of the lines in the LinkedList in reverse
order.
Modify Exercise 1 so that the name of the file you read is provided as a
command-line argument.
[61]Design Patterns, Erich Gamma et al., Addison-Wesley 1995.
[62] It’s not clear that this was a good design decision, especially compared to the simplicity of I/O libraries in other languages. But it’s the justification for the decision.
[64] Chapter 13 shows an even more convenient solution for this: a GUI program with a scrolling text area.
[66] A chapter dedicated to strings will have to wait until the 4th edition. Mike Shea contributed to this section.
[67] I have no idea how they came up with this method name, or what it’s supposed to refer to. But it’s reassuring to know that whoever comes up with nonintuitive method names is still employed at Sun. And that their apparent policy of not reviewing code designs is still in place. Sorry for the sarcasm, but this kind of thing gets tiresome after a few years.