Big Java, 2nd ed. / Java Concepts, 4th 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.

[B3C2] = fixed in Big Java's 3rd printing, Java Concepts 2nd printing
[B3] = fixed in Big Java's 3rd printing

The following errata apply both to Big Java and Java Essentials

[B3C2] Page vii (Big Java), Page ix (Java Concepts)
Change "a a very simple subset" to "a very simple subset".
[B2C2] Page xxxi (Big Java Only)
23.6 should be "Case Study: Algorithm Animation"
[B3C2] Page 34
Change "What type should you use use for the variable" to "What type should you use for the variable".
[B2C2] Page 35
Change "and the underscore (_) character" to "and the underscore (_) and dollar ($) characters".
Page 48
Change "Why doesn’t the MoveTester program print the width and height of the rectangle?" to "Why doesn’t the MoveTester program need to print the width and height of the rectangle?"
[B2C2] Page 60 Exercise P2.5
Change brighten to brighter
[B2C2] Page 60 Exercise P2.6
Change darken to darker
[B3C2] Page 62 Project 2.2
Add the following as the first line of the program.
import java.awt.Color;
[B3C2] Page 81 Syntax 3.5
The word "or" should not be italic.
Page 120
Change ln(x) to loge(x) and add a row
Math.log10(x) Decimal log (log10(x), x > 0)
[B3C2] Page 138 Table 4
Change "Left justification" to "Left alignment".
[B2C2] Page 149 Exercise P4.18
Change Year to Easter
[B3C2] Page 153 EmptyFrameViewer.java
Change the first line to
import javax.swing.JFrame;
[B2C2] Page 186 Exercise P5.9
Change "by allowing the user to specify houses of different sizes in the House constructor" to "by supplying a House constructor for specifying the position and size"
[B2C2] Page 187 Exercise P5.16
Before "Change the CarComponent class...", insert "Change the Car class so that the size of a car can be specified in the constructor."
[B3C2] Page 197
Change "r2 - 2 equals 0" to "(√2)2 - 2 equals 0"
[B3C2] Page 215
In line 7, change if (in.hasNext()) to if (in.hasNextInt())
[B3C2] Page 218
Change "the logician Augustus de Morgan" to "the mathematician Augustus de Morgan".
[B2C2] Page 246 Common Error 7.3
Change "To make the semicolon really stand out, place it on a line by itself, as in the first example." to "You can avoid this error by using an empty block { } instead of an empty statement." (The old advice was correct, but the replacement is an improvement. Thanks to Michael Beeson for pointing this out.)
Page 289 Quality Tip 8.1
Change
BankAccount a = (BankAccount) a.get(0); 
to
BankAccount a = (BankAccount) accounts.get(0); 
[B2C2] Page 289 Self-Check 4
Change
ArrayList<String> names = new ArrayList();
to
ArrayList<String> names = new ArrayList<String>();
Page 317 Exercise P8.2
Change "Add a method toString to the Purse class that prints the coins" to "Add a method toString to the Purse class that returns a string describing the coins"
[B2C2] Page 351
Change
import static java.lang.System;
import static java.lang.Math;

to
import static java.lang.System.*;
import static java.lang.Math.*;

[B2C2] Page 367 Exercise P9.8
Change distance to angle. Change "the distance between two points" to "the angle between the x-axis and the line joining two points". Change "display the distance" to "display the angle". (The Point2D class already has a distance method, and it makes no sense to replicate it in a static method.)
[B2C2] Page 367 Exercise P9.10
Change
public static int readInt(String prompt, int min, int max)
to
public static int readInt(Scanner in, String prompt, int min, int max)
Page 397
Change
if ("aeiouy".indexOf(ch) >= 0)
to
String vowels = "aeiouy";
if (vowels.indexOf(ch) >= 0)
(2x)
[B3C2] Page 481 Syntax 13.3
Change "ClassName(parameters)" to "accessSpecifier ClassName(parameterType parameterName, . . .)" (to match Syntax 3.2).
[B2C2] Page 548 Exercise R14.7
Change SliderTest to SliderFrameViewer
[B2C2] Page 561
In the first code block, change reader = new FileReader(filename) to FileReader reader = new FileReader(filename)
[B2C2] Page 574
In the answer to #7, change  "the catch clause" to "the finally clause"
[B2C2] Page 589
Change "Just set the file pointer to 50 x the record size" to "Just set the file pointer to 49 x the record size"
[B2C2] Page 638
Remove the sentence “We will implement a . . . the display”.
[B2C2] Page 640
Below the second bullet, add another:
[B2C2] Page 642
Remove lines 1 and 2 (import java.io.IOException and a blank line) of ATM.java
[B2C2] Page 645
Remove line 1 (import java.io.BufferedReader) of Bank.java
[B2C2] Page 646
Remove line 29 (boolean done = false;) of Bank.java
[B2C2] Page 694 Exercise R18.5
Change "Exercise P17.11 shows" to "Exercise P18.12 shows"
[B3C2] Page 712
After "when the size of the array doubles", change "(2n2) = 4n2" to "(2n)2 = 4n2"
[B3C2] Page 743
Change obj to element (2x)
[B2C2] Page 745
Change "The remove method removes and returns" to "The remove method removes"
[B3C2] Page 748
Change obj to element (2x)
[B3C2] Page 749
Change obj to element (2x)
[B2C2] Page 749 Figure 4
The next field of the rightmost node should have an arrow like the rightmost node in Figure 5, instead of containing data.
[B3C2] Page 753
Change obj to element (5x)
[B3C2] Page 752, 753
In figure 7, remove both arrows that emanate from the previous field of the ListIterator. Eliminate the blue (4) label both from the figure and the code on the facing page. [The figure is inaccurate--after the call to add, the previous reference is set to position so that an invalid call to remove can be trapped. This has nothing to do with understanding the add method, so it is best not to show those arrows at all. At any rate, the remove behavior of the Java library is so poorly conceived that it is best not to dwell on it.]
[B3C2] Page 760
Change value to element (3x)
[B3C2] Page 764
Change x to element (3x), change "item" to "element" (5x)
[B2C2] Page 779
Remove line 2 (import java.util.Iterator;) of SetTester.java
[B3C2] Page 782
Remove line 3 (import java.util.Iterator;) of MapTester.java
[B2C2] Page 788 Line 99
Change @param a hash set iterator to @return a hash set iterator
[B3C2] Page 790 SetTester.java
Change line 11 to
Set names = new HashSet(101); // 101 is a prime
[B2C2] Page 794
Remove line 2 of HashCodeTester.java
[B2C2] Page 796 and 833
Change "each of which has two child nodes" to "each of which has at most two child nodes"
Page 805
Replace line 112 with
      if (smallestParent == toBeRemoved) 
         smallestParent.right = smallest.right; 
      else 
         smallestParent.left = smallest.right; 
[B2C2] Page 806
Change line 138 to
   if (comp < 0)
Change line 143 to
   if (comp > 0)
Before line 138, add a line
   int comp = newNode.data.compareTo(data);
[B2C2] Page 812
Remove line 2 (import java.util.Iterator;) of TreeSetTester.java
[B2C2] Page 812
In TreeSetTester.java, change the comment "A program to test hash codes of coins." to "A program to test a comparator for coins."
[B2C2] Page 850
Removes lines 1 and 2 (import java.util.LinkedList; and import java.util.ListIterator;) of ListTester.java
[B2C2] Page 851
Replace
staff.addLast("Dick");
staff.addLast("Harry");
staff.addLast("Romeo");
staff.addLast("Tom");
with
staff.addFirst("Tom");
staff.addFirst("Romeo");
staff.addFirst("Harry");
staff.addFirst("Dick");
(Our generic LinkedList class doesn't have an addLast method.)
[B3C2] Page 855
Change the third line from the bottom to
public static void reverse(List<?> list)
Change the last line from the bottom to
public static <T> void reverse(List<T> list)
[B2C2] Page 861
Remove  < 0) from the fifth line of the answer to Self-Check #8
[C2] Page 874 (Java Concepts only)
Add java.io.Serializable before java.lang.Cloneable
[C2] Page 876 (Java Concepts only)
Remove java.lang.Serializable
[B2] Page 889 (Big Java only)
The section heading for section 23.6 should be "Case Study: Algorithm Animation"
[B3C2] Page 1105 (Big Java), 898 (Java Concepts)
Change HashSet<K, V> to HashSet<E> (2x)
[B3C2] Page 1109 (Big Java), 901 (Java Concepts)
Change TreeSet<K, V> to TreeSet<E> (2x)
[B3] Page 1138 (Big Java only)
In the entry for final, change "executed" to "extended".
[B3] Page 1155 (Big Java only)
Change if (b < 0) b = -b; to if (b < 0) b = (byte) -b;
[B3] Page 1156 (Big Java only)
The fifth line from the bottom should be
100decimal = 0 10000101 10010000000000000000000single-precision IEEE
[B3] Page 1156 (Big Java only)
In the second line from the bottom, change "mantissa = 0" to "mantissa = ±0". In the last line, change "mantissa ≠ 10...0" to "mantissa ≠ ±0"
[B3] Page 1161 (Big Java only)
Change "Figures 1 and 2 show the notation for classes and interfaces." to "Figure 1 shows the notation for classes and interfaces. You can optionally supply attributes and methods--see Figure 2.".
[B3] Page 1181 (Big Java), 927 (Java Concepts)
The index entry for BlueJ should also refer to pages 83, 87
[B2C2] Page 1198 (Big Java), 942 (Java Concepts)
The index entry for javax.swing.JOptionPane should also refer to page 139

Download the latest version of bigjava.zip to get the fixed code files. 

Thanks to Matthew Backus, Matthew Boutell, Chris Colvard, Radu Cornea, Michael Costanzo, Marcello Dalpasso, Theresa DuBose, John Gallagher, Jianchao Han, Rodney Hoffman, Jason James, Chris Kelly, Joe Kmoch, Peter Lao, David Mayer, Kathleen O'Brien, Carl Owenby, Arthur Ritmeester, Bill Shay, Jørgen Villadsen, Christine Wallace, Charlie Zhang, and (your name might go here) for their bug reports and suggestions

Please report any remaining bugs in this edition on the bug report form.