Forums Register Login

Some minor typos about chapter 3 (Java OCA 8 Programmer I Study Guide)

(1 cow) 1
+Pie Number of slices to send: Send
1. On page 136, Autoboxing, last paragraph, 1st sentence:
Everything is clear in this explanation but maybe “outputs 1” should be “outputs [1]”.


2. On page 141, in the last example:
Semicolon is missing after statement

3. On page 148, the third example, 1st line:
There is no any typo, everything is ok. But I guess that authors intend to declare variable name as shortDate instead of shortDateTime. Because formatting is regarding only date.


4. On page 340, mock explanation #4:
“At this point sb contains abbbaa”abbbaa should be abbaa.

The same question in online material:
abbbaa and abbbaccca should be abbaa and abbaccca in explanation respectively. Option B was already noted in errata list.


1
+Pie Number of slices to send: Send
 

Mushfiq Mammadov wrote:1. On page 136, Autoboxing, last paragraph, 1st sentence:
Everything is clear in this explanation but maybe “outputs 1” should be “outputs [1]”.


Correct! The output of that code snippet is [1].

Mushfiq Mammadov wrote:2. On page 141, in the last example:


Indeed! Semicolon should be added.

Mushfiq Mammadov wrote:3. On page 148, the third example, 1st line:
There is no any typo, everything is ok. But I guess that authors intend to declare variable name as shortDate instead of shortDateTime. Because formatting is regarding only date.


Although nothing wrong with both code snippets, but probably shortDate is a slightly better variable name.


Mushfiq Mammadov wrote:4. On page 340, mock explanation #4:
“At this point sb contains abbbaa”abbbaa should be abbaa.


Well spotted! We have an empty StringBuilder and we append three a's and insert only two b's => after the first two method invocations, sb contains abbaa (almost a very famous Swedish pop group ).

Hope it helps!
Kind regards,
Roel
+Pie Number of slices to send: Send
Logged #1, 2 and 4 in the errata.

For #3, the variable name has dateTime because the class is DateTimeFormatter. The "short" in the name was intended to convey that it is a short format that just has the date.
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 6405 times.
Similar Threads
Online Mock exam 2 (Java OCA 8 Programmer I Study Guide)
Some minor typos, chapter 3 (Java OCA 8 Programmer I Study Guide)
Some minor typos in chapter 4 (Java OCA 8 Programmer I Study Guide)
Minor typo about method returns on page 313, chapter 6 (Java OCA 8 Programmer I Study Guide)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:09:21.