Errata, Absolute Java 5th edition, Walt Savitch
Error list as of 3/20/2015. Email any errors to kenrick@uaa.alaska.edu
-
Page 139: In the for loop box, "l0" should be "10" (digits 10 instead of the letter L and 0)
-
Page 116, Chapter 3. The line "else if (s1.compareTo(s2) < 0)" should be "else if (s1.compareTo(s2) > 0)"
-
Page 368: In "Methods that return an array", "char i" should be "int i" for the first set of sample code and for self-test exercise 12.
-
Page 407: method fillGrade:
grade[studentNumber][quizNumber] =
a[studentNumber][quizNumber];
should be
grade[studentNumber-1][quizNumber-1] =
a[studentNumber-1][quizNumber-1];
to avoid an ArrayoutofboundException.
-
Page 485: "If the method invocation is associated with the method invocation when the method is invoked (at run time)..." better stated as "If the method definition is associated with the method invocation when the method is invoked (at run time)..."
-
Page 497: : Pitfall, Lines 4-5:
s.showAdertisement();
discount.showAdertisement();
should be
s.showAdvertisement();
discount.showAdvertisement();
-
Page 589/639: On Self-Text Exercise #4, the answer to this is now "Yes". This functionality was added to the constructor after Java 1.5.
-
Page 685: Programming Project #4, "59" in the diagram should be 57
-
Page 713: Display 13.1, Line 4, o2.preceded(o1) should be o2.precedes(o1)
-
Page 771: In the blue box, the foreach loop does not modify each element in the ArrayList, since "element" is just set to a new reference value. A better example would be to output each element via "System.out.println(element);" which does output each item in the ArrayList.
-
Page 911: Line 45 should read: setUnion.addAll(green);
-
Page 1090: theThread.run() should be theThread.start()