B.J.O. 2nd Edition Errata:

I've worked hard, as have my editorial support staff at Apress, to make sure that the second edition of Beginning Java Objects is as error-free as possible. Nonetheless, with the help of my readers, we've found a handful of substantive errors in the book; the corrections are printed below.

If you find any other errors that are not reported below, please let me know so that I may post the corrections here as well reporting them to Apress: jacquie@objectstart.com

Best regards,

86 Aug. 24, 2005 Table 3-3 should be entitled "Professor Class Attributes."
131 Aug. 24, 2005 The comment within the updateMajor() method is incorrectly worded; it should instead read as follows:

public void updateMajor(String major) {
.. // In the next line of code, "this.major" on the LEFT side
.. // of the assignment statement refers to the ATTRIBUTE
.. // of the Student class named "major", whereas "major"
.. // on the RIGHT side of the assignment statement refers
.. // to the PARAMETER named "major" that is being passed in to
.. // the updateMajor method.
.. this.major = major;
186, 187 Aug. 28, 2005 Pages 186 and 187 both contain references to the class hierarchy shown in Figure 5-5. These should actually be references to Figure 5-7.
191 Oct. 3, 2005 The second bullet on page 191 contains a typo; with regard to Figure 5-8 on that same page, the second bullet should read as follows:
"F is therefore overriding the print() method of A as inherited by B."
198 Oct. 3, 2005 The passage below is incorrect, and should be REMOVED from the discussion regarding protected accessibility on page 198:

However, protected features are not accessible by classes that aren't derived from the superclass. For example, the following would not compile:

public class Example {
.. public static void main(String[] args) {
.... Student s = new Student();
.... // Details omitted.
.... s.age = 23; // This would NOT compile if age were declared
................ // to be protected in Person.

.. }

To properly understand the implications of protected accessibility requires an understanding of Java packages. Packages are addressed in Chapter 6 of Beginning Java Objects 2nd Edition on pages 228 - 233 and again in Chapter 13 on pages 547 - 552. Click here to download a expanded version of the material from Chapter 13 regarding accessibility (PDF format).
244, 245 Oct. 3, 2005 At the bottom of page 244, the name of the method used to check a HashMap for containment of an object as a value should be containsValue(); that is, the method signature should appear as follows:

boolean containsValue(Object value)

Thus, all invocations of the contains(...) method in the code examples on page 245 should be changed to invocations of containsValue(...) instead.
314, 315, 319 Oct. 3, 2005 The reportTotalEnrollment() method of the Student class is shown to have a return type of int, but the method as written does not return an int value. Hence, the code as illustrated will not compile. The return type of the method should instead have been specified as void.
462 Oct. 5, 2005 The StringBuffer class is included in the core java.lang package, not in the java.util package as stated, and so an import statement is not required.
582 Aug. 24, 2005 In the first paragraph on page 582, I refer to the display() method of the Transcript class, and promise to discuss it later in the chapter. I actually don't discuss the display() method later in the chapter; it is, however, included in the downloadable source code for the Transcript class.