Errata for "Just Java" 6th ed, first printing (2004) Novermber 25 2009. Some of these errata have been corrected in later printings. SIGNIFICANT CORRECTIONS p.171, second sentence in para headed "Polymorphism", change from: "and it merely means using the same one name to refer to different methods" to: "and it means allowing the same code to be used with different types. In Java, it is implemented by allowing several different methods to have the same name, making it look like one method to the API user." p.237 first sentence on page, change to "You cannot clone any enum object - java.lang.Enum disallows it with a final clone() method that throws an exception." p.256 In making the comparison between a local class and an anonymous class I wrote an anonymous class "is an even more concise way of writing an event handler than a local class. With a local class you have to provide all the method bodies. With an anonymous class, you cram it into the instantiation and only provide method bodies for the methods you want to change." But that's not right. A local class is not required to override all methods in the class it is extending, again, only the methods that it wants to change. p.392, first code line on page, change to: Scanner sc = new Scanner(System.in); p.392, first sentence after code line, change to read: "You get a scanner by calling one of the eight constructors of java.util.Scanner." p.527, delete the 8th line of code in the code example "jframe.setVisible(true);" (unwanted duplicate of later line) LESS SIGNIFICANT TYPOS p.xx, last text para on page, change entire para to: "Two and a half years in the making, Sun wanted to make a big splash with its latest release of Java. So Sun switched the name from the confusing old brand of "J2SE version 1.5" to the confusing new brand of "J2SE version 5". "The mysterious "2" slipped in there in 1998, when Sun changed the name at the last minute to emphasize the difference between standard Java, and the non-portable version that Microsoft had deviously created. That's all water under the bridge now, and everyone wishes that Sun would use a sensible, simple version number, like "Java 5". But instead "J2SE version 5" it is. Well, whatever name the marketing geniuses at Sun apply, this release is the biggest and most significant so far. Table 2 shows some of the substantial language additions." p.xx Table 2, leftmost col, change "Java 2 v1.5" to "J2SE 5.0" (in the column headed "Release"). p.3 6th line up from foot, change "Java 2 version 1.5" to "Java 2 version 5" p.7 4th para, 2nd line, change "will be only ever be" to "will only ever be" p.8 3rd para, 2nd to last line, insert space before "Statements" p.13 middle of second para, change sentence starting "As cell phone and PDA..." to "As cell phones continue to evolve PDA features, and thus to push PDAs off the market, Java is available for both. Java completely dominates the cell phone programming market, and has squeezed all rivals out of this space." Then start new para. p.18 First para, from second sentence on, replace with: "The current version of the JDK is called "J2SE version 5", i.e. Java 2 Standard Edition version 5 of the Software Development Kit. During beta testing, this release was called version 1.5, and you may still hear old timers call it "JDK 1.5". It was promoted to version 5 in recognition of the large number of core language changes in the release. p.19 3rd line on page, "ofdelay" missing a space. p.20 3rd to last line on page "sureto" missing a space p.28 first sentence of last non-box para on page, insert space after "error-prone." p.29 "amongthem" missing a space. p.30 first sentence of last para, "... the object t has to..." the "t" should be in courier font. p.30 penultimate para on page (not counting footnote), add a sentence at end: "(Unless you link some non-Java code with your program; then the non-Java code could forge an invalid pointer)." p.31 "$20Mto" missing a space. p.32 "append them)Java" missing period and space. p.57 code at bottom of page. delete the word "native" (3 places) p.59 second para. Put the bold text starting "boolean" into a fixed width font p.59 midpage. Sentence starting "So String has an equal() method..." should be "So String has an equals() method..." i.e. added an "s". p.59 method names in bold (mid page, and near foot of page) delete the word "native" (2 places) p.186 8 lines up from foot of page, "Chapter 11" s.b. "chapter 10". p.223, first sentence on page, starting "For backwards compatibility..." change entire sentence to read: "When using assert statements, Sun's JDK 1.4 compiler needs the '-source 1.4' command line option. That option is not needed when using Sun's Java 5 compiler". p.235, third line of last para, the "O" in Object" should be in courier p.238 near foot of page: subtype change to: subtype put the word "subtype" in italic font p.259 second line up from foot of page, MIN_RADIX should be in courier font. p.345 7th line from foot of page, change "foreach" to "for". p.356 last para, 4th line, the entire word "tailSet()" should be in courier. p.364, the tenth line(including code), change "myArray[0] = ld;" to "arrayOfLists[0] = ld;" keep indentation the same, of course. p.364, the twelfth line(including code), change "example(myArray);" to "example(arrayOfLists);" keep indentation the same, of course. p.370 Last line of code on page, change "for (Map.Entry me : s) {" to "for (Map.Entry me : s) { " p.371 2nd and 3rd lines of code on page, change from: Object ok = me.getKey(); Object ov = me.getValue(); to: String k = me.getKey(); String v = me.getValue(); p.396 Sun has dropped the "^" flag (meaning uppercase) p.419 Sun has dropped the "^" flag (meaning uppercase) - twice in code p.445 9th line up from foot, change "its a hint" to "it's a hint" p.459 last sentence of EBCDIC entry in tabel (mid page), change to "An EBCDIC chart is shown in Appendix C." p.469 Under "Two cautions" the wildcard should be "?????" not "???" p.471 last sentence, change "on the CD" to "on the website afu.com/jj6" p.503-505 mention jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); p.530 show html in buttons etc http://java.sun.com/docs/books/tutorial/uiswing/components/html.html p.636, first para following the "TIP: ..." heading last part of last sentence, change "(like their NX plan for hardware to prevent stack cracking)" to "(like the NX - No eXecute - hardware change supported in Windows XP SP2 to prevent stack cracking)" p.663 Sun has dropped scanner.create() in favor of a constructor p.686 The easiest way to get the servlet jar file is to download Tomcat from apache.org and put it in your lib/ext directory. END OF ERRATA my email address for reporting more errata is: p v d l a t a f u d o t c o m I am grateful to the following people who have reported errata: Yoshiki Shibata Brian Scearce Mark Kuschnir Richard Green Rodolfo Gouveia