Java in a Nutshell, 3rd Edition by David Flanagan This errata page lists errors outstanding in the most recent printing. If you have any error reports or technical questions, you can send them to booktech@oreilly.com. (Please specify the printing date of your copy.) This page was updated February 27, 2001. Here's the key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification Confirmed errors: (13) second paragraph under "Declaring a variable and parsing input": Cut the sentence "They make this formula ... not just a specific set like:" and the code line that follows. Join the next paragraph ("A variable in a Java program...") to the previous paragraph. ***The following error applies only to the 3/01 printing of the book:*** {25} second code example; The code reads: byte sum = (byte) (b1 + b2); // Sum wraps to 128, which is the smallest byte It should be changed to read: byte sum = (byte) (b1 + b2); // Sum wraps to -128, which is the smallest byte ***The following error applies only to the 3/01 printing of the book:*** {25} Floating-point types; All three comments are missing a multiplication sign. (37) The second paragraph of the section "Conditional AND (&&)" reads: This operator (and all the Boolean operators except the unary ! operator) have a lower precedence.... HAVE should be HAS. (49) last paragraph: "cannot contain a runtime expressions" should read "cannot contain a runtime expression". (50) middle: "are commonly used as a loop counters" should read "are commonly used as loop counters". (71) top: "following code that manipulate" should read "following code that manipulates". (76) The second bulleted paragraph on this page ("All array types...with an explicit cast.") should be deleted. In third bulleted paragraph, the first sentence, "Arrays do not have a type hierarchy, but..." should also be deleted. A new bulleted paragraph at the end of the list (after the code example) should be added: An array of a primitive type cannot be converted to an array of any other type. However, an array of reference type A can be converted to an array of reference type B through a widening or narrowing conversion if type A can be converted to type B through a widening or narrowing conversion. For example, a String[] value can be assigned to a variable of type Object[]. (87) 1st full paragraph: "which is is perfectly" should read "which it is perfectly". (88) 1st full paragraph: "method has such an long, awkward" should read "method has such a long, awkward". <104> Fourth and fifth paragraphs; In the fourth paragraph, change "in the overriding method" to "in the overriding class" In the first sentence of the 5th paragraph, change "from within the method that overrides it" to "from within the class that overrides it". (104) 5th paragraph: "there is no way for a program that uses an object" should read "there is no way for a program that uses that object". (105) "Access Control" paragraph: "In an number of" should read "In a number of" {106} The footnote on this page should be removed. {109} sample code; Instead of: protected checkRadius(double radius){ ... } the method should be: protected void checkRadius(double radius){ ... } (115) 4th paragraph: "If you use an abstract clas, ...." should be "class." [134] Synchronized entry; In the third column of the entry for "synchronized", change: The method makes non-atomic modifications to the class or instance, so care must be taken to ensure that two threads cannot modify the class or instance at the same time. To this: The method is not inherently thread-safe, so this modifier tells the Java interpreter to ensure that no other synchronized method of this object or class is run at the same time as this one. [138] code section, line 13 from the bottom: t.getChars(0, 3, ca, 1); // Put 1st 3 chars of s into ca[1]-ca[3] should read: t.getChars(0, 3, ca, 1); // Put 1st 3 chars of t into ca[1]-ca[3] {150} 2nd code example, near bottom of the page: The code example is written: Timer.schedule(displayTime, 0, 1000); which is not correct. The line should be timer.schedule(displayTime, 0, 1000); to access the object "timer" and not the class "Timer". (180) section discussing JavaBeans: When "indexed property" is defined (halfway down the page), "property" is mistakenly split into "proper ty". (194) 2nd paragraph, 2nd line: Cut one "such as". [291] Second full paragraph; Change: lastModified() returns the modification time of the file (which should be used for comparison with other file times only and not interpreted as any particular time format) To: lastModified() returns the modification time of the file in milliseconds since January 1st, 1970 (494) The table should be changed as follows: Month MMM (name) MM (2 digits) M (1 or 2 digits) to Month MMMM (full name) MM (2 digits) MMM (short name) M (1 or 2 digits) (516) Class: GregorianCalendar says: ...numbered from the birth of Christ that is used is most locales throughout the world should say: ...numbered from the birth of Christ that is used in most locales throughout the world