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
n
is 17 and m
is 18” to “assuming that n
and m
have type int
, n
is 17, and m
is 18”PI
to Math.PI
(3x)if (weight < 0)
to if (weight <= 0)
and "Error: Weight cannot be negative"
to "Error: Weight must be positive"
.if (ch == ' ')
to if (ch == 'A' || ch == 'a')
. (Without this change, the comment about declaring ch
outside the loop would not be applicable.)const
to final
{ return true };
to { return true; }
[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]
.
6E6 6,995.00
to 6E6 $6,995.00
if (offset > LETTERS)
to if (offset >= LETTERS)
http://theory.lcs.mit.edu/~rivest/rsapaper.pdf
to http://people.csail.mit.edu/rivest/Rsapaper.pdf
try
block” to “until it is caught by another try
statement”public void add(String question)
to public void add(String choice)
and choices.add(question);
to choices.add(choice);
BankAccount
in public BankAccount (double initialBalance)
import java.util.ArrayList;
void presentQuestion()
to public void presentQuestion()
if (input == "Q")
to if (input.equals("Q"))
panel = new JPanel();
to
JPanel panel = new JPanel();
panel = new JPanel();
to
JPanel panel = new JPanel();
checkBoxPanel.add(pepperoniButton()); checkBoxPanel.add(anchoviesButton());
to
checkBoxPanel.add(pepperoniButton); checkBoxPanel.add(anchoviesButton);
sumHelper(int[] a, int start)
adds a[start]
and sumHelper(a, start + 1)
”. 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.” coll = new TreeSet<String>()
and after Iterator<String> iter = coll.iterator()
lst
” to “Suppose the list letters
”HashSet<K, V>
to HashSet<E>
Map<String, TreeSet<DistanceTo>>
to Map<String, HashSet<DistanceTo>>
.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
.
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
.
size
method/operation in Exercise P16.4”/ to “the size
method in Exercise P16.6”get
operation” to “the get
method”n / 10
” to “position n - n % 10
”G F E D C
more = v.visit(n);
to
more = v.visit(n.data);
SavingsAccount[] savingsAccounts = new SavingsAccount[10]; BankAccount[] bankAccounts = savingsAccounts; // Legal
and the second code block to
BankAccount harrysChecking = new CheckingAccount(); bankAccounts[0] = harrysChecking; // Throws ArrayStoreException
FileWriter
to PrintWriter
2xpublic void Card(int aValue) { value = aValue; }
to private Card(int aValue) { value = aValue; }
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
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!