First Printing Errata (January 3, 2014)

Chapter 1

Page 10, New Information for Section 1.5. After this edition was published, Oracle announced that Java applets will not be supported in the future edition of Java due to security concerns.

Page 11, 7 lines before the Check Point, change deskop to desktop.

Page 28, under Key Terms, change modem 00 to modem 6.

Chapter 2

Page 38, 7 lines before Listing 2.3, change java.uitl.* to java.util.*.

Page 39, Add a new Note after the note on IPO. Click here to see the new note.

Page 47, line 2, change "an odd" to "a positive odd".

Page 67, under Key Terms, change wildcard import 00 to wildcard import 38.

Page 73, in the output box for Programming Exercise 2.16, change 78.5895 to 78.5918.

Chapter 3

Page 77, line 14 in Listing 3.1, change number to answer.

Page 94, Table 3.5, the word true in "(age > 28) && (weight <= 140) is true, because (age > 28) is false" should be changed to false.

Page 111, Programming Exercise 3.18, change 50 to 20.

Page 116, line -3, change 5 to 1.

Page 117, line -5, change "the each" to "each".

Chapter 4

Page 120, in Table 4.1, change toDegree(radians) to toDegrees(radians).

Page 121, lines 1 and 2, change the sentence "The return value for asin ..." to "The return value for asin and atan is an angle in radians in the range between -p/2 and p/2 and for acos is between 0 and p.

Page 121, the line before Section 4.2.3, change 4.24 to 3.24.

Page 121, line -2, change "rounded up to" to "rounded to".

Page 122, line 2, Math.ceil(2.1) should return 3.0. Line 9, Math.floor(-2.1) should return -3.0. Line 7 in Section 4.2.4, Math.max(2.5, 3) should return 3.0.

(This is for the Second printing) Page 122, line 9, change it to "Math.floor(-2.1) returns -3.0".

Page 123, line 5, Change to

Page 128, in Table 4.6, change isLetterOfDigit to isLetterOrDigit.

Page 136, Table 4.10, first line, change index(ch) to indexOf(ch).

Page 143, change line 16 in Listing 4.4 to char ch = Character.toUpperCase(hexString.charAt(0));

Page 149, the first item in Chapter Summary, change cell to ceil.

Page 152, change 74 in the sample run for Exercise 4.5 to 72.

Page 153, in the sample output for Exercise 4.13, remove the word grade.

Page 155, last line in Exercise 4.18, change chracters to characters..

Chapter 5

Page 152, change 74 in the sample run for Exercise 4.5 to 72.

Page 167, two lines before Check Point  Question 5.1, the line should be

java SentinelValue < input.txt > output.txt

Chapter 6

Page 203, the cover page for Chapter 6, in the last last, change 6.10 to 6.11.

Page 205, three lines after Figue 6.1, change "Chapter 8" to "Chapter 9".

Page 221, line 4, change matches to match.

Page 229, line 18, change Boolean to boolean.

Page 232, in the middle of the page, change getNumberOfDayInMonth to getNumberOfDaysInMonth.

Chapter 8

Page 289, the line after Figure 8.1,  change "row 2" to "row at index 2" and "column 1" to "column at index 1."

Chapter 9

Page 323, in Figure 9.3, change "double setRadius" to "void setRadius".

Page 336, Section 9.6.3, first line, change conveninent to convenient.

Page 336, Two lines before Listing 9.5, change Lisitng to Listing.

Page 337, CheckPoint Question 9.15, change "Point2D? How" to "Point2D, how".

Page 363, line 2, change x = 0 to c = 0.

Chapter 10

Page 374, line 2, change addStuent to addStudent.

Page 407, Programming Exercise 10.25, change  "returns a, b, ?, b, gf, #, and e" to "returns a, ?, b, ?, gf, #, and e".

Chapter 11

Page 412, Listing 11.2, line 2, missing { at the end of the line.

Page 433, , "remove(index: int): boolean" should be replaced with "remove(index: int): E".

Page 435, line 2, change True to true.

Page 443, under Key Terms, change override 000 to override 419.

Page 448, Programming Exercise 11.15, in the sample input data, change the last number from -3.5 to -13.5 and change the output area from 250.075 to 292.575.

Chapter 12

Page 450, the sample output for Listing 12.1, last line ends with 13 not 11.

Page 485, lines 9 and 22 in Listing 12.18, change craw to crawl.

Page 486, in the output box, change craw to crawl.

Page 492, note that you can download baby name files using the URL such as  for Programming Exercise 12.31.

Chapter 13

Page 498, four lines before Listing 13.2, change Listings 13.2 and 13.3 to Listing 11.2 and 11.3.

Page 501, A typo in Figure 13.2, change longVlaue to longValue.

Page 508, add the following note before Check Point Question 13.13. Note: Java 8 introduced default interface methods and also permits public static methods in an interface. For more information, see

Page 532, line 5 in the output box for Exercise 13.7, change -13.75i to -15.75i.

Chapter 14

Page 536, line 11 in the first paragraph of Section 14.2, change seemlessly to seamlessly.

Page 537, in the last line of the first paragraph, change Supplement II.I to Supplement III.Z.

Page 546, line 3 after Figure 14.8, change where to whether.

Page 550, in Figure 14.12, the data type for height, width, and progress is ReadOnlyDoubleProperty.

Page 551, three lines after Figure 14.14, change iamge to image.

Page 552, last paragraph, change sethGap(double) to setHgap(double) and change hGapProperty() to hgapProperty().

Page 556, the last sentence in the first paragraph, change "remains" to "remaining".

Page 559, line 1, change Listing 14.12 to Listing 14.13.

Page 564, line 7, change Listing 14.15 to Listing 14.16.

Page 570, in Figure 14.39, change javafx.scene.shape.Arc to javafx.scene.shape.Polygon.

Chapter 15

Page 590, the first line after Figure 15.5, change 34 to 32.

Page 609, change unknow to unknown in the last line.

Page 619, in the first line after Listing 15.18, Application is misspelled.

Chapter 16

Page 631, line 28 in Listing 16.1, change Retanlge to Rectangle.

Page 634, 4 lines in Section 16.4, Change selection property to selected property.

Page 639, 5 lines in Section 16.6, T-Strom should be T-Storm.

Page 648, In the caption for Figure 16.19, change SelecitonMode to SelectionMode.

Chapter 19

Page 743, three lines before Listing 19.3, change line 7 to line 10.

Page 749, Figure 19.6, change the last "A<B' subclass>" to "A<B' superclass>".

Chapter 21

Page 801, line 43 in Listing 21.2, change common to non-common. Also change common to non-common in the output box.

Page 802, line 19 in Listing 21.3, change Object to String.

Page 806, in Question 21.8, change the last line in the code to input.close().

Page 808, in Question 21.14, change "add and insert" to "append and delete". In Question 21.15, change "add and insert" to "insert and delete".

Page 815, in line 12 in Listing 21.9, change { to {}].

Page 816, in line 33 in Listing 21.9, change entry.getValue() + "\t" + entry.getKey() to entry.getKey() + "\t" + entry.getValue().

Chapter 22

Page 835,  line 12, change "is divisible by" to "divides". In line13, change "is divisible by" to "divide".

Chapter 23

Page 864,  Check Point Question 23.2, change a bubble to an insertion.

Chapter 25

Page 938,  line 89, change the method name preorder to postorder.

Page 938,  line 102, change the method name postorder to preorder.

Page 954,  line 3, change BinraryTree to BST.

Chapter 27

Page 1006, in code line 101, change the comment to // Remove the element from the bucket

Chapter 29

Page 1076, the line above the margin note time complexity, change conatins to contains.

Chapter 30

Page 1103, in the last line in Note, change "that has stopped" to "that it has stopped".

Chapter 31

Page 1142, Figure 31.2, change DataOutStream on the left box to DataOutputStream.

Page 1151, code line 99, change IOException e to IOException ex.

Page 1168, The two check point questions should be labelled 31.12 and 31.13.


Sandi Snyder (Ozarks Technical Community College), 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 Jose 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), Lawrence Mao (University of Northern Florida), Michael J. Ondrasek (Wright State University), Michael Hamm (Armstrong student), Kevin Stolp (Orange County College), Paolo Galtieri, Ken Martin (University of Northern Florida), David Winfield, Jerry Keeney (University of Maryland), Jae Wook Shin, Charon Leith (St. Petersburg College, Florida), Jian Zhang (Texas Women's University), Jeremy Haberman, Kevin Eisinger, Dave Poplawski (Michigan Technological University), Ashwin Kansagra, MD, Sydney Wu, Erin Wenham (University of Southern Florida), Victor Shoup (NYU), Virgil Grogean (Wright State University), Dave Busse (Chattahoochee Tech), Henk Schotel (Netherlands), Trond Borgen Mork (Ericsson Norway), Thomas Warren (Emory University), Marsha Burger (NYU), John A. Feist, Fabian Contreras (New Jersey Institute of Technology), Vincent Le Corre (France), Kyle Walker, David Blech (NYCCT CUNY), Tely Diallo (NSF), Brian David Backstrom (Century College), Michael An, Patrick Wijntjes (The Netherlands), Stefan Andrei (Lamar University), Damien O'Brien (Australia), Chuck Burchard (PSU), Noemi Talamantes (U of Texas, Dallas), Eddie Gerlach, Jeremiah Oon (Nanyang Technological University, Singapore), Christopher Gooley (Northern Virginia Community College), Georgios Christodoulakis, Matthew Stone, Amanda Rollason (Kennesaw State University), Thomas R. Cooke (University of Maryland), GAO SHI (HKUST), Mark Lewton, Rahul Nilange, Michael P. Rogers (Northwest Missouri State), Zachary Farnsworth (University of Maryland), Jun Ni (University of Iowa), Peter Nguyen, Yi Lou (Lehigh University), Dhruv khanna (Southern University), Marijan Hoborka, Janna Heidelberg (Armstrong student), Benjamin Chopson (Armstrong student), Imed Mehdaoui (Netherlands), George Lazik (Cal State Northridge), Andrii Petrychak (Fjordane University College, Norway), Dani Speh (JKU Linz, Austria), Jharyd Marhkain (Australia), Dave Slate (U. of Illinois), Michael Bernard (Armstrong State University), İsmail Burak YAVRU (Anadolu University, Turkey), Ozan Demirhan (Italy), Devlin J. Hyna (Northeastern Illinois University), Sharon Harvey (Normandale Community College), Brad Yourth (St. Petersburg College), Ming-Jyh Tsai (蔡明志, Fu-Jen Catholic University, Taiwan), Kristian Recio (UT Brownsville), Ruby Vazquez (Northeastern Illinois University), Albert E. Glock, Jr. (University of Colorado at Colorado Srpings), Speh Dani (JKU Linz), Tareq Si Salem, Jameson Morgan (Wright State University), Roya Javadi (Sharif University of Technology), Calvin Scott, Neal Messer (Indiana University of Pennsylvania), Margaret Roemer (University of Wisconsin–Madison), Kevin Weming Zhao (Northwest University, China), Dave Gibson (Valdosta State University), Chen Jin (University of Southern California), Ric Webster (DuPage, Illinois), Lloyd Smith (Darton College, Albany, Georgia), Larry Thomas (Univ. of Toledo), Joseph DiNatale III (Armstrong State University), Brooke Weborg (Univ. of Toledo), Lloyd Smith (Darton College, Georgia), Stoyan Vrazhalov (Bulgaria), Prem Kumar (NW Missouri), Omar Alsaleh (King Saud University), Kelvin van Eijk (University of Amsterdam), Worawit Lalit (Thailand), Ed Orejel (California State University, Los Angeles), Sheung Hung Poon from Brunei (School of Computing and Informatics Institut Teknologi Brunei Brunei Darulssalam), Kavin-Lee (China), Zubair Muhammad (Pakistan), Jordan Rogers (Armstrong State University), Sasha Kachanov (Elmhurst College), Levent Divilioglu (Istanbul Technical University), Jonathan S. Weissman (Finger Lakes Community College), Rick Upton (University of Santa Cruz Silicon Valley Extension), Chuankai Zhou (Humber college Ontario Canada), Bob Perry (Duke University) Andrii Petrychak (Fjordane University College, Norway), Dani Speh (JKU Linz, Austria), Jharyd Marhkain (Australia), Dave Slate (U. of Illinois), Michelle Ming (University of South Florida), Alberto Alfaro (National Autonomous University of Mexico), Abdul Quadir, Rob Swenson, William Bahn (University of Colorado, Colorado Springs).

Please send errata to Thanks for helping improve the book!