Errata

Think Java

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Mobi Page Vocabulary, Location 360 of 7640
Third point in the vocabulary section

It should be "processor" instead of "processo".

Anonymous  Aug 14, 2022 
Printed Page page 89 in section: String Formatting
the last block of code on the page, right before the chapter lists vocabulary words

public static String timeString(int hour, int minute) {
String ampm;
if (hour < 12) {
ampm = "AM";
if (hour == 0) {
hour = 12; // midnight
}
} else {
ampm = "PM";
hour = hour - 12;
}
return String.format("%02d:%02d %s", hour, minute, ampm);
}

What happens when you enter between 12:00 noon & 12:59? You will get 0:00-0:59 PM. You should probably put an...
else if (hour == 12) {
ampm = "PM";
}
in between the two blocks. Please let me know if I am wrong. Thank you.

Jimmy Betesh  Mar 20, 2023 
Printed Page Pg 88. Last paragraph in section Substrings ch 6
Last paragraph in paragraph substrings. In middle of pg 88

Off by one error: The 2nd argument in fruit.substring(2, fruit.length() - 1) should not have a “-1” in it since that would exclude the last letter of the string “banana” which they say is supposed to return “nana”. According to the current arguments it would only return “nan” not “nana”.

Jimmy Betesh  Jun 26, 2023 
2
Online book: Chapter1: What is Programming, 3rd Section "What is Programming"

Word "Secision" should be "Decision"

CURRENTLY SHOWS:

Secision

Check for certain conditions and execute the appropriate code.

Anonymous  Apr 19, 2020 
2
Online book: Chapter1: What is Programming, Vocabulary Section

The work "processor" is missing the letter "r" at the end.

processo

A computer chip that performs simple instructions like basic arithmetic and logic.

Ben Larson  Apr 19, 2020 
Printed Page 194
Code example, for-loop

The example says:
for (int k = 0; k < d3.length; k++) {...}

I think you need to use d3.cards.length instead of d3.length, as the class Deck itself does not have any attribute called 'length'.

Johannes  Oct 13, 2020 
Printed Page 207
middle

The lastCard() function (and other places beyond that) has no qualifier and only uses size() but at the top of p207 the popCard() function uses cards.size()

Shouldn't lastCard() use a qualifier for size() as well?

dan bromberg  Aug 23, 2020 
Printed Page 209
2nd paragraph

You say class CardCollection has methods getLabel, size, and getCard but I cannot find them in your class definition on page 206.

dan bromberg  Jul 25, 2020 
ePub Page 223.6
Wrapper Classes

when I run the below code show on the page,
Integer x = Integer.valueOf(123);
Integer y = Integer.valueOf(123);
if (x == y) { // false
System.out.println("x and y are the same object");
}
if (x.equals(y)) { // true
System.out.println("x and y have the same value");
}

It gives,
"x and y are the same object"
"x and y have the same value"

Instead of giving only as it said in the book,
“x and y have the same value”

jj  Nov 10, 2020