Developers: Learn a New Programming Language or App Development with Deitel LiveLessons Videos!
Login  |  Register  |  Media Kit  |  Press  |  Contact Us  |   Twitter Become a Deitel Fan on Facebook  
Custom Search
AddThis Social Bookmark Button

Errata: Java How to Program, 6/e

We wish to thank our many readers who took the time to email us with errata. If you find errata not listed on this page, please email us at Remember to include the book title and edition.

Note: You can determine which printing you have by looking at the bottom of the back of the second physical page in the book (page iv, but it has no page number). Just above the ISBN number is a list of numbers. For the first printing of the book, the list appears as follows:

10 9 8 7 6 5 4 3 2 1

The last number in the list is the printing number. So the above list indicates printing 1 and the following list indicates printing 2:

10 9 8 7 6 5 4 3 2

Chapter 2

  • p55, Fig. 2.13: the arrow pointing from the result of step 3 into step 4 should point to the value 15 not the value 50. Download the corrected page.

Chapter 3

Chapter 4

  • Example 4.12 on page 151 line 7 public void processExamResults has no parenthesis () after it. However in the example the parenthesis are present. Furthermore without the parenthesis the program will not compile.
  • Missing GUI/Graphics examples from the CD included with the book (Chapters 3-4)
  • Page 151, Fig. 4.12, Line 7: Missing left and right parentheses ( ) at end of line
  • Page 177: Exercises 4.35 and 4.36 are duplicates.

Chapter 5

  • The version of class GradeBook printed on p. 194 will not compile. Line 69 incorrectly lists numericGrade as the name of the parameter of method incrementLetterGradeCounter, but the method body uses a variable named grade. The example file on the CD that accompanies the book, however, has the correct parameter name—grade—so the included file should compile. Changing either the parameter name to grade (as it is on the CD), or changing line 72 to use numericGrade will fix the problem.
  • In chapter 5, in figure 5.19, the precedence/associativiy of the operators discussed so far is given. In this, I think the prefix operator "--" is incorrectly specified as "-". I see "-" mentioned twice there, which I presume to be "-" prefix operator and "--" prefix operator.

Chapter 6

  • page 259, Section. 6.11, last paragraph of section, second line from end, change variable name "start" to "begin".

Chapter 8

  • page 360, Fig. 8.1, line 13, missing left brace {
  • page 408, 12th bullet on page should read: EnumSet static method range takes two parameters—the first enum constant in a range and the last enum constant in a range—and returns an EnumSet that contains all the constants between these two constants, inclusive.

Chapter 9

  • page 431, Fig. 9.8, Line 14 changed variable name to "salary".

Chapter 10

  • Page 474, Line 49: gethours should be getHours
  • Page 489, 13 lines down from top of page: "implement" should be "implements"

Chapter 11

  • page 557: Lines 31 and 32 of Fig. 11.31 are never used. They can be deleted.

Chapter 14

  • page 680, Fig. 14.4, Line 35, change "else" to "if"
  • page 682, 3rd full paragraph, 7th line, change "file.pathseperator" to "file.seperator"
  • New exercise description for Exercise 14.14:

    Modify Exercise 11.18 to allow the user to save a drawing into a file or load a prior drawing from a file using object serialization. Add buttons Load (to read objects from a file) and Save (to write objects to a file). Use an ObjectOutputStream to write to the file and an ObjectInputStream to read from the file. Write the array of MyShape objects using method writeObject (class ObjectOutputStream), and read the array using method readObject (ObjectInputStream). Note that the object-serialization mechanism can read or write entire arrays—it is not necessary to manipulate each element of the array of MyShape objects individually. It is simply required that all the shapes be Serializable. Because the array of MyShape objects has 100 elements and the array is not necessarily filled with shapes drawn by the user, you may also want to store to the file the number of shapes drawn so far. For both the Load and Save buttons, use a JFileChooser to allow the user to select the file in which the shapes will be stored or from which they will be read. When the user first runs the program, no shapes should be displayed on the screen. The user can display shapes by opening a previously saved file of shapes or by drawing their own shapes. Once there are shapes on the screen, users can save them to a file using the Save button.

  • On Page 682 (Chapter 14.4), you mention that the separator character, which is OS-dependent, should be had by using File.pathSeparator.

    It should be File.separator, which returns “/” or “\”. File.pathSeparator returns “:” or “;”, which is used in a %PATH% or $PATH search variable.

Chapter 22

  • Page 1036, 3rd full paragraph, second sentence is incomplete. It should read, "The argument JTabbedPane.TOP sent to the constructor indicates that the tabs should appear at the top of the JTabbedPane.

Chapter 23

  • Page 1105, remove exercise 23.7 (blank) and everything else should move up by one (this is correct in the instructor's manual)

Chapter 29

  • Page 1364, section 29.3.8, last paragraph of section, should be "Note: Lines 12-13 use literal values 10000000000L and 2.5f as ...".
  • Page 1364, section 29.3.8, last paragraph of section, 10000000 should be replaced with 10000000000 in the last paragraph of Section 29.3.8.
  • Page 1376, last paragraph,  says " ... Lines 8-9 instantiate two Character objects and pass character literals to the constructor to initialize those objects. ..." This is not true, because lines 8-9 do not use the Character constructor, instead, auto-boxing occurs.

Safari Trial Subscriptuon

Java How to Program, 6/E Cover

ISBN: 0131483986
© 2005, pp. 1500

Order now at

Download Code
Examples and
Other Premium
Content for
Registered Users

Login or Register to download this book's code examples and other premium content.

Update :: November 19, 2019