Java Reference
In-Depth Information
Figure 3-1. String, StringBuilder, and C-language strings
Although we haven't discussed the details of the
java.io
package yet (we will, in
Chapter 10
)
, you need to be able to read text files for some of these programs. Even if you're
not familiar with
java.io
, you can probably see from the examples that read text files that a
BufferedReader
allows you to read “chunks” of data, and that this class has a very conveni-
ent
readLine()
method.
I won't show you how to sort an array of strings here; the more general notion of sorting a
collection of objects is discussed in
Sorting a Collection
.