Big Java Late Objects / Java for Everyone

Bug Report Page

.  .

How to Tell which Printing You Have

On the copyright page (facing the first page of the Preface), there is a printing history of the book. The printing history is a row of numbers that—at the 1st printing—looks like this:

10 9 8 7 6 5 4 3 2 1

At each subsequent printing, one number is removed from the end of this row of numbers to indicate which printing of the book you have. For example, the last number in the row of numbers in the 2nd printing is 2, and so on.

[B3E2] = fixed in Big Java's 3rd printing, Java for Everyone 2nd printing
[B3] = fixed in Big Java's 3rd printing

Page 44 [B2E2]
Change “convert a convert” to “convert a”
Page 45
In Self Check 14, change “positive number” to “positive integer”
Page 69
Change “assuming that n is 17 and m is 18” to “assuming that n and m have type int, n is 17, and m is 18”
Page 79
In answer 12, change PI to Math.PI (3x)
Page 137 [B2E2]
Change if (weight < 0) to if (weight <= 0) and "Error: Weight cannot be negative" to "Error: Weight must be positive".
Page 164
In Self Check 29, change the second “The average is 88” to “The average is 84”
Page 166
Change “the first space” to “the first letter A”, and change if (ch == ' ') to if (ch == 'A' || ch == 'a') . (Without this change, the comment about declaring ch outside the loop would not be applicable.)
Page 169 Self Check 36 [B2E2]
The reference should be to Section 4.7.6, not 4.7.5.
Page 195 Exercise P4.34
Change const to final
Page 199/200 [B2E2]
Change “unchanged from its initial value” to “ set to the last character of the string, or, if the string is empty, is unchanged from its initial value”
Page 211 [B2E2]
In Self Check 14, change { return true }; to { return true; }
Page 244 Exercise P5.31 [B2E2]
Change y = c z + d (1 – z) to y = c (1 - z) + d z
Page 267/268 and 647/648
Change the array to
[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
1 4 5 8 9 12 17 20 24 32

In the next paragraph, change a[3] to a[4]. Change the next array to

[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
1 4 5 8 9 12 17 20 24 32

Change “Now the last value of the first half of this sequence is 17” to “The middle element of this sequence is 20”. Change the next two arrays to

[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
1 4 5 8 9 12 17 20 24 32

and

[0] [1] [2] [3] [4] [5] [6] [7] [8] [9]
1 4 5 8 9 12 17 20 24 32

In the paragraph below, change a[5] to a[6].

Page 329 Self Check 8 [B2E2]
Change 6E6 6,995.00 to 6E6 $6,995.00
Page 333
Change if (offset > LETTERS) to if (offset >= LETTERS)
Page 336 Change the URL http://theory.lcs.mit.edu/~rivest/rsapaper.pdf to http://people.csail.mit.edu/rivest/Rsapaper.pdf
Page 340
Change “until it is caught by another try block” to “until it is caught by another try statement”
Page 359 [B2E2]
Change “Because a comma is not considered a part of a floating-point number to “Because a dollar sign is not considered a part of a floating-point number”
Page 390
Change public void add(String question) to public void add(String choice) and choices.add(question); to choices.add(choice);
Page 399 [B2E2]
Remove the space after BankAccount in public BankAccount (double initialBalance)
Page 419 QuestionDemo.java [B2E2]
Remove line 1 import java.util.ArrayList;
Page 433
Change void presentQuestion() to public void presentQuestion()
Page 441
Change if (input == "Q") to if (input.equals("Q"))
Page 443 Figure 9 [B2E2]
Change fuchsia to olive and 20 to 15 in the second object. Change 7 to 15 in figure 9 and 10 (3x)
Page 463
Change “16. a only.” to “16. a and c.”
Page 483 Code listing line 72 [B2E2]
Change
panel = new JPanel();

to

JPanel panel = new JPanel();
Page 486 Code listing line 76
Change
panel = new JPanel();

to

JPanel panel = new JPanel();
Page 519 [B2E2]
Change
checkBoxPanel.add(pepperoniButton());
checkBoxPanel.add(anchoviesButton());

to

checkBoxPanel.add(pepperoniButton);
checkBoxPanel.add(anchoviesButton);
Page 546 [B2E2]
Add "The center button fills the remainder of the window." to the end of the answer of self check 4.
Page 596 [B2E2]
Self Check 12. Change “Of course, it would be inefficient to set up an actual array of the remaining values. Which recursive helper method can solve the problem?” to “Design a recursive helper method to solve this problem.”
Page 597 [B2E2]
After Self Check 13, add: “Why is this less efficient?”
Page 621 Exercise P13.11 [B2E2]
Change (x + g/x) / 2 to (g + x/g) / 2.
Page 625 [B2E2]
Change the answer to Self Check 12 to: “The method sumHelper(int[] a, int start) adds a[start] and sumHelper(a, start + 1)”.
Change the answer to Self Check 13 to: “sum(a) can make a new array smaller containing a[1]...a[a.length - 1] and compute a[0] + sum(smaller). But it is inefficient to make a copy of the array in each step.”
Page 642
Change “perfor0mance” to “performance”
Page 667 [B2E2]
Change the numerator of the second fraction from (1 + log(2)) to 1 + log(n)
Page 672 Table 1 [B2E2]
Add a semicolon after coll = new TreeSet<String>() and after Iterator<String> iter = coll.iterator()
Page 677 Self-Check 7 [B2E2]
Change “Suppose the list lst” to “Suppose the list letters
Page 692 Table 9 [B2E2]
Change “Each call to remove removes the lowest priority item:” to “Each call to remove removes the most urgent item:”
Page 703 [B2E2]
Change HashSet<K, V> to HashSet<E>
Page 705 Exercise R15.21 [B2E2]
Place the letter C into (9,6), D into (9, 9), and E into (9,10). There should be nothing in (8,3).
Page 710 P15.33 Change Map<String, TreeSet<DistanceTo>> to Map<String, HashSet<DistanceTo>>.
Page 719 [B2E2]
Change

If the previous reference equals position, then this call to remove does not immediately follow a call to next, and we throw an IllegalStateException.

Note that, according to the specification of the remove method, it is illegal to call remove twice in a row. Our implementation handles this situation correctly. After completion of the remove method, previous equals position, and an exception occurs if remove is called again.

to

According to the specification of the remove method, it is illegal to call remove twice in a row. Our implementation handles this situation correctly. After completion of the remove method,  the isAfterNext flag is set to false. An exception occurs if remove is called again without another call to next.

Page 750 Exercise R16.5 [B2E2]
Change

Instead, one can set the previous instance variable to null at the end of every call to add or remove.

to

Instead, one can set the previous instance variable to a special value at the end of every call to add or remove.

Page 750 Exercise R16.7, R16.8, R16.9 [B2E2]
Change “the size method/operation in Exercise P16.4”/  to “the size method in Exercise P16.6”
Page 750 Exercise R16.8, R16.9 [B2E2]
Change “the get operation”  to “the get method”
Page 750 Exercise R16.15. [B2E2]
Change “in a linked list” to “in a doubly linked list”
Page 750 Exercise R16.16 [B2E2]
Change “position n / 10” to “position n - n % 10
Page 782 [B2E2]
In Figure 16, in the stack display, the third line should have the last three elements highlighted: G F E D C
Page 782 [B2E2]
Change
more = v.visit(n);

to

more = v.visit(n.data);
Page 827/828 Common Error 18.2 [B2E2]
Change the first block to
SavingsAccount[] savingsAccounts = new SavingsAccount[10];
BankAccount[] bankAccounts = savingsAccounts; // Legal

and the second code block to

BankAccount harrysChecking = new CheckingAccount();
bankAccounts[0] = harrysChecking; // Throws ArrayStoreException
Page 828
In the table of Special Topic 18.1, interchange “lower bound” and “upper bound”.
Page 857 Exercise R19.2 [B2E2]
Change FileWriter to PrintWriter 2x
Page 917 (Appendix E)
After “Potential modifiers are public, static, final. ”, add “All constructors are private.” Change public void Card(int aValue) { value = aValue; } to private Card(int aValue) { value = aValue; }
Page W980
Change
String urlName = . . .;
URL u = new URL(urlName);
Document doc = builder.parse(u);
to
String url = . . .;
Document doc = builder.parse(url);

Thanks to Anton Antonov, Don Braffitt, Anthony Clark, Taylor Corey, Stephen Gilbert, Charles Harless, Cindy Johnson, Brad Jones, Pat McDermott-Wells, Doug McNally, Andre Fesko, Su Olschesky, Adrian O'Riordan, Marcelo Pineyro, James Pope, David Taylor, Rick Zaccone, and (your name might go here) for their bug reports and suggestions

Bug Report Form

Please use this form to report any bugs that you find. Please check the list of known bugs first before you report a bug. Unfortunately, I do not have the time to respond personally to every report, but I do read them all and will post updates to this page. Thank you!

Your name:

Your email address:

Page number:

Problem description:

To protect against spam robots, please answer this simple math problem:
* =