The book has a description of each library class, such as String or Vector, and presents the interface of each in a handy condensed form. The book is handy to keep around for quick reference. Thanks to Herb Weiner for the suggestion. Specifying public means that the variable or method is accessible everywhere, and is inherited by any subclasses that extend from the class. But we will offer from time to time some performance tips that may be useful.
Many performance techniques apply in any programming language.
It takes about 13 seconds using JDK 1.0 on a Pentium. When we profile the program, we find that it seems to be doing lots of data shuffling and so forth, with the garbage collector called 40 times. To append to a String you must copy out the String to a StringBuffer and append to it and then convert it back. Note that we captured the old value of ss before ss was changed to point to a new String. The old String didn't change when we reassigned ss, we just changed a reference that pointed at it to point at a new String.