Core Version
Comprehensive Version
Introduction to Java Programming, 7E
 
Y. Daniel Liang

First Printing Errata (May 4, 2008)

Preface

(For the comprehensive version) Page ix: In the chapter dependencies diagram,

"Chapter 18 "Exception and Assertions" should be "Exception Handling".

"Chapter 22 Algorithm Efficiencies" should be "Chapter 23 Algorithm Efficiencies" and "Chapter 23 Lists, Stacks, and Queues" should be "Chapter 24 Lists, Stacks, and Queues".

Chapter 1

Page 20, line 13, remove the last ). Same for the label in the next figure.

Chapter 2

Page 29, first tip: change section number referenced from 2.15 to 2.13.

Chapter 3

Page 86, first line in Section 3.4, change Listing 3.5 to 3.7.

Chapter 5

Page 150, line 8 in Listing 5.6 should be deleted.

Page 172, In Exercise 5.7, "in Exercise 2.9" should be "in Exercise 2.13."

Page 176, Exercise 5.27, delete "So are 17 and 71." 

Page 178, Exercise 5.31, "public boolean" should be "public static boolean"  

Chapter 6

Page 181: line 9, newdouble should be new double.

Page 189: Section 6.4, newint should be new int.

Page 200: line 7, i- should be i--.

Page 202: line 9 in Listing 6.9, k- should be k--.

Page 207, In item 5 (Which row has the largest sum?), move the if statement from the inner loop to the outer loop. So the new code looks as follows:

        for (int row = 1; row < matrix.length; row++) {
          int totalOfThisRow = 0;
          for (int column = 0; column < matrix[row].length; column++) 
            totalOfThisRow += matrix[row][column];

          if (totalOfThisRow > maxRow) {
            maxRow = totalOfThisRow;
            indexOfMaxRow = row;
          }
        }     
Chapter 7

Page 231: Figure 7.4, circle2: Circle should be underlined.

Chapter 8

Page 269: line -8, WABlcome should be WABcome.

Page 270: line -3, returns 8 should be returns 9.

Page 271: two line after Figure 8.8, returns 8 should be returns 9.

Page 287: in Figure 8.18, nextline should be nextLine.

Page 292: in Review Question 8.1, change "String s4 = s3.intern();" to "String s4 = "Welcome to Java";".

Page 294: in Review Question 8.17, "Show the value of s2" should be "Show the value of s1".

Chapter 9

Page 314: Figure 9.6, the second addStudent should be dropStudent.

Page 318: code line 29, change [-size] to [--size].

Page 319: line 4, change 16 to 2.

Chapter 10

Page 359: in Programming Exercise 10.5, change Listing 9.8 to Listing 9.6.

Chapter 11

Page 370: second paragraph, howToEach should be howToEat.

Page 375: in Listing 11.9, line 12, change public double to public int.

Page 377: in the Caution box, change (line 28) to (line 27). 

Chapter 13

Page 421: Swap the filled diamond with the diamond in Figure 13.1.

Page 429: the first line in the third paragraph after Listing 13.4, change "line 8" to "line 10".

Page 444: the first line in Exercise 13.9, change four cards to three cards.

Chapter 14

Page 449: line 3, change "In line 11," to "In line 9."

Page 459: two line before Listing 14.7, change "drawPolygon" to "drawPolyline".

Chapter 15

Page 486: the second line from the bottom, change OKListener() to OKListenerClass().

Chapter 16

Page 525: source code Listing 16.4, line 38 in the comment, change check boxes to radio buttons.

Page 547: delete Question 16.4. 

Chapter 18

Page 616: In Review Question 18.1, RunTimeException should be RuntimeException.

Chapter 22

Page 707: In Figure 22.3, missing > in the addAll method and the composition solid diamond should be moved to the other end.

Page 732: In Listing 22.12, line 16, > 1 should be > 0.

Page 740: In Exercise 22.12, plain should be plane.

Chapter 23

Page 747: In Table 23.1, in the third line number 23.431 should be 2.43.

Page 749: 10 lines before Listing 23.2, change m to n and change m / 2 to n / 2.

Page 749: 2 lines before Listing 23.2, change m to n and delete the sentence "This revision does not work for the case when m is equal to n."

Page 749: Line 8 in Listing 23.2, change if (m == n) return m to

    if (m % n == 0) return n;

Page 763: Review Question 23.6, change list.length to list.length - 1 and change i = 0 to i = -1.

Chapter 25

Page 831: In Exercises 25.5 and 25.6, change "Displays" in the comment to "Returns the number of".

Chapter 27

Page 865: 3rd line in the UML diagram for the Graph interface, getVertices(index: int) should be getVertex(index: int).

Chapter 35

Page 1153: Figure 35.6, in both (a) and (b), the diamond should be on the component side, not the interface side.

Chapter 36

Page 1213: line 12 in Listing 36.13 , change model.getRoot() to root. The output of the program should now be

JTree colors blue violet red yellow sports basketball soccer

football hockey food hot dogs pizza ravioli bananas

Appendix D

Page 1275: strictfp can be applied on method, not on constructor.

Credits:

Sandi Snyder (Ozarks Technical Community College), Larry Phillmon, Brian Eddy (Armstrong Atlantic State University), James Chegwidden (Tarrant County College), Danijel Abramović (Siemens), Claudio Valderrama C. (SW developer, consultant), Bryan Cool (University of Missouri, St. Louis), Derek Snow (University of South Alabama), Andreas Jordan (Australia), John Logan (San José State University), Brad Shank (Indiana Tech), Jeremy Barksdale (NC A&T State University), Ralph Kelsey (Ohio University), John Towell (Carroll College), Vedat COSKUN (Turkey), Ray Toal (Loyola Marymount University), Ken Lodge (Charles Sturt University, Australia), Scott Nigel (California Lutheran University), Brandy DePhillip (Windsor Continental Corporation), John Collier, Wayo Puyati (UBU, Thailand), Elnur Abdurrakhimov(Russia), David Dorenbos (Software Engineering Research Center, IL), Trevor Bowen (Adtran Mixed Signal IC Tools and Methodology), Haining Chen (Bethel College), Dave Gibson (Valdosta State University), John Jenkins (University of Maryland).

Please send errata to y.daniel.liang@gmail.com. Thanks for helping improve the book!