Big Java Early Objects, 6th ed. / Java Concepts, 8th ed.

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.

When an error is fixed in a reprint, it is marked with a code such as [B3C2] = fixed in Big Java's 3rd printing, Java Concepts 2nd printing.

Page vi
Remove “The discussion of polymorphism and inheritance is split into two chapters.”
Page 76 P2.9
Change = LocalDate(1919, 4, 9) to = LocalDate.of(1919, 4, 9)
Page 78 Answer to Self Check 28
The second line of the answer should be
Hello
Page 85
Change “Recall from Chapter 12” to “Recall from Chapter 2”
Page 121 E3.5
Change int switch to int switchNum since switch is a reserved word (2x)
Page 141
In Self Check 10, change “positive number” to “positive integer”
Page 165 Exercise R4.21
Change “ a program” to “pseudocode for a program”
Page 175
In answer 3, change PI to Math.PI (3x)
Page 226
Change getNumericGrade to getLetterGrade
Page 248 R5.15
Change “In Worked Example 4.1” to “In How To 5.1”
Page 253
Change year = year + n; to year = year + numberOfYears;
Page 267
In Self Check 29, change the second “The average is 88” to “The average is 84”
Page 269
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 300 Exercise P6.10
Change “Why did he, on average, lose a bet that at least one six would appear when rolling a die four times? And why did he seem to win a similar bet...” to “Why did he, on average, win a bet that at least one six would appear when rolling a die four times? And why did he seem to lose a similar bet...”
Page 301 Exercise P6.15
Change const to final
Page 305
In Answer 24, change nextDouble to hasNextDouble
Page 330
In Step 3, remove
else if (scoresSize == 1)
{
   return scores[0];
}
Page 352 Practice It
Change E7.17, E7.20 to E7.18, E7.22
Page 365 Exercise E7.19, 20, 21. Change “Exercise E7.17” to “Exercise E7.18”.
Page 380
Change ArrayList<String> accounts to ArrayList<BankAccount> accounts and studentNames.size() to accounts.size()
Page 413 Exercise E8.5
Change “to be immutable. Change mutator methods to return new Day objects.” to “to be mutable. Change the methods addDays, nextDay, previousDay to mutate the implicit parameter, and to return void.”
Page 438
In Syntax 9.3, change choices = new ArrayList<String>; to choices = new ArrayList<String>();
Page 449
Change if (input == "Q") to if (input.equals("Q"))
Page 461 Exercise P9.1
Change java.time.Instant.now().toString() to java.time.LocalTime.now().toString()
Page 461 Exercise P9.3
Change “An appointment has a description (for example, “see the dentist”) and a date” to “An appointment has a description (for example, “see the dentist”) and occurs on one or more dates”.
Page 500
javx.swing.JComponent should be javax.swing.JComponent
Page 512
Exercises E10.4 and E10.5 should have a “Java 8” icon.
Page 518 Answer to Self Check 19
if (m.getMeasure(a) > m.getMeasure(b)) should be
if (m.measure(a) > m.measure(b))
Page 527
String line = nextLine(); should be String line = in.nextLine();
Page 535
Change if (offset > LETTERS) to if (offset >= LETTERS)
Page 543
Change “until it is caught by another try block” to “until it is caught by another try statement”
Page 563 Answer to Self Check 12
Change null null to "" ""
Page 626 Self Check 20
“with the first queen in position a2” should be “with the first queen in position b1
Page 676
Change the numerator of the second fraction from (1 + log(2)) to 1 + log(n)
Page 684
Change “The add method adds an object after the iterator, then moves the iterator position past the new element.” to “The add method adds an object before the iterator position.”
Page 686
Change “Write a loop that prints every second element of a linked list of strings called words.” to “Write a loop that prints every other element of a linked list of strings called words, starting with the element at the front.”
Page 693
Change “ print all key/value pairs in a map m” to “ print all key/value pairs in a map m whose keys have type String
Page 694 Java 8 Note 15.1
Change (oldValue, value) -> oldValue + value to (oldValue, notPresentValue) -> oldValue + notPresentValue
Page 704
In the last row of the “Unprocessed Input” column in the last table, change 4 + 5 to 4 × 5
Page 711
Change HashSet<K, V> to HashSet<E> and TreeSet<K, V> to TreeSet<E>
Page 719 P15.12
Change sell quantity to sell quantity price
Page 719 P15.13
Change sell symbol quantity to sell symbol quantity price
Page 719 P15.14 Change Map<String, TreeSet<DistanceTo>> to Map<String, HashSet<DistanceTo>>.
Page 748, 751, 752 (2x)
Interchange the lines if (h < 0) { h = -h; } and position = h % arrayLength;. (In the very unlikely case that h == Integer.MIN_VALUE, this order is correct.)
Page 755
Change the first two lines of the program run to
Sue
Harry
Page 756 Special Topic 16.2
Change “and move that element into the slot of the removed element (Exercise P16.14).” to “and move that element into the slot of the removed element. Then rehash all elements that follow until you reach an empty slot (Exercise P16.14).” Add a bubble “Rehash this element” to the element at index h + 5.
Page 758 Exercise R16.16
Change “the reference at position n – n % 10” to “the reference at index n / 10
Page 760 E16.8
Change java.util.LinkedList to java.util.List and java.util.AbstractList to java.util.AbstractSequentialList
Page 761 E16.20
Change ((a h + b) % p) % L to |((a h + b) % p) % L|
Page 761 P16.1
Remove static from the getNode method.
Page 763 E16.14
After “replace it with the last such element”, add “and rehash the remaining elements of the probing sequence”
Page 790 Self Check 23
“Figure 17” should be “Figure 16”
Page 792
Change log(n + 1) to log2(n + 1) (2x)
Page 810 section_7/HeapSorter.java
Change the comment “Sorts an array, using selection sort.” to “Sorts an array, using heap sort.”
Page 812
Change Self Check 16 to: “What is the result of calling HeapSorter.fixHeap(a, 1, 4) and then HeapSorter.fixHeap(a, 0, 4) where a contains 1 4 9 5 3?”
Page 822 Answer to Self Check 29
In the last figure, the "X" node should not be the right child node of node n2 but should be the right child node of n4.
Page 831 Self Check 13
Change “If you have an array list
ArrayList<String> a = new ArrayList<>(10);
how do you fill it with ten "*"?” to: “If you have an ArrayList<String> a, how do you replace all elements with "*"?”
Page 833
Change
BankAccount bankAccounts = savingsAccounts;
to
BankAccount[] bankAccounts = savingsAccounts;
Page 834
In the table of Special Topic 18.1, interchange “lower bound” and “upper bound”.
Page 837
Change Self Check 22 to: “Suppose we want to implement a method that computes both the minimum and maximum of an array of measurable objects, returning an array of length 2:
public static <E extends Measurable> E[] minmax(E[] objects)
Why doesn’t this work?” Change the answer to: The method would need to create the array of length 2 and type E. However, you cannot construct an array of a generic type.
Page 842 E18.14
Change “generic class” to “generic interface”
Page 843 P18.4
Change “generic class” to “generic interface”
Page 843 P18.6
Change “Write a static generic method” to “Using the java.util.function.Predicate interface, write a static generic method”
Page 879
In answer 3, add i++; below if (s.length() > 10) { result.add(s); }
Page 893 Code listing line 76
Change
panel = new JPanel();

to

JPanel panel = new JPanel();
Page W998
Change the code
try (Socket s = server.accept())
{
   BankService service = new BankService(s, bank);
   Thread t = new Thread(service);
   t.start();
}
to
Socket s = server.accept();
BankService service = new BankService(s, bank);
Thread t = new Thread(service);
t.start();
(This is one of the few situations where try-with-resources doesn't work. The socket can only be closed when the thread is done.)
Page W999
Change lines 20 - 26 to
Socket s = server.accept();
System.out.println("Client connected.");
BankService service = new BankService(s, bank);
Thread t = new Thread(service);
t.start();
Page W1000
Change lines 35 - 37 to
try
{
   in = new Scanner(s.getInputStream());
   out = new PrintWriter(s.getOutputStream());
   doService();
}
finally
{
   s.close();
}
Page W1067
Change
String urlName = . . .;
URL u = new URL(urlName);
Document doc = builder.parse(u);
to
String url = . . .;
Document doc = builder.parse(url);
Page W1035
Change “Otherwise, the first call to result.next() fetches the data for the first row from the database.” to “Otherwise, the first call to result.next() sets the ResultSet object to visit the first row from the query result.”. Change “that all rows have been fetched” to “that all rows have been visited”. Change “Once the result set object has fetched a particular row” to “When the ResultSet object visits a particular row”
Page W1109
Change “that, is” to “that is,”
Page W1115
Change “A property is an entity ” to “A property is a value ”
Page A-65 (Appendix I)
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; }
Chapter 17 Worked Example 2 Page 13
assertEquals(letters, t.toString().remove(" ", ""));
should be
assertEquals(letters, t.toString().replace(" ", ""));
Chapter 17 Worked Example 2 Page 14
Change “435,974,400 red-black trees with black height 2” to “25,728,160,000 red-black trees with black height 3”
Chapter 17 Worked Example 2 Page 18
Change “The resulting tree has constant black height, but it might still not be a valid red-black tree because it might have double-red violations. We could test just that, but we need to have a general method that tests the red-black properties after the removal.” to “The resulting tree might not be a valid red-black tree. It might have some leaves with greater black height than the node to be removed, or it might have double-red violations. We will develop a method to check that a red-black tree is valid and call it before and after the removal.”
Chapter 19 Worked Example 2 Page 2
Change
.min((s, t) -> s.length() < t.length())
to
.min((s, t) -> s.length() - t.length())

Thanks to Taylor Corey, Cromwell Cutaran, Marcello Dalpasso, Michael D'Egidio, Steve Gilbert, Charles Harless, Doug McNally, Joaquim Mendes, Mark Oliva, Karl Reese, Adrian O'Riordan, Craig Stutzman, Larry A. 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:
* =