• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 42073
932
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic