• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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

 
Ranch Hand
Posts: 207
27
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.


 
Sheriff
Posts: 11338
177
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
 
author & internet detective
Marshal
Posts: 38687
677
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!