• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mushfiq Mammadov
Ranch Hand
Posts: 187
25
Java jQuery Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic