Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt K&B SCJP 5 pg. 440 File Creation

 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In 3rd para: "...constructing a Reader or Writer will automatically create a file for you..."

Should perhaps read: "...constructing a FileWriter or PrintWriter will automatically create a file for you..."

(Readers don't create files, nor do most Writers.)
 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to nitpick again. Page 458, "Working with Dates", reads:

With the help of the Locale class you'll be able to convert a date like "10/08/2005" to "Segunda-feira, 8 de Outubro de 2005" in no time.

Should instead read:

With the help of the Locale class you'll be able to convert a date like "10/08/2005" to "S´┐Żbado, 8 de Outubro de 2005" in no time.

Since October 8, 2005 was actually a Saturday.
 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also on the next page (465), 2nd para from bottom reads in part:

"Notice that because we were using a SHORT style, we lost some precision when we converted the Date to a String."

The above statement is wrong. The time component was "lost" because getDateInstance() was used instead of getDateTimeInstance(). The SHORT style has nothing to do with it.
 
Ade Barkah
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In pg. 563 (Using Maps) the comparison in the code segment "((Dog)o).name == name" should perhaps be rewritten using equals() instead. Otherwise the comparison may fail if a non-literal String was used to construct the Dog object.
 
Bert Bates
author
Sheriff
Posts: 8900
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good catches Ade - noted, thanks!
 
Septimiu Pelau
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ade Barkah:
In 3rd para: "...constructing a Reader or Writer will automatically create a file for you..."

Should perhaps read: "...constructing a FileWriter or PrintWriter will automatically create a file for you..."

(Readers don't create files, nor do most Writers.)


...or a FileOutputStream
 
Bert Bates
author
Sheriff
Posts: 8900
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Septimiu,

We appreciate eagle eyes looking for errors and improvements, thanks!

BUT, this thread was almost 2 years old Since then, we've fixed errata in the book, it's been reprinted a couple of times, and most recently there is a whole new edition!

The bottom line is that it's almost never a good idea to resurrect an old thread like this. Far better to just start a new thread!

Thanks,

Bert
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic