wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt K&B SCJP 5 pg. 440 File Creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt K&B SCJP 5 pg. 440 File Creation" Watch "Doubt K&B SCJP 5 pg. 440 File Creation" New topic
Author

Doubt K&B SCJP 5 pg. 440 File Creation

Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
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<br /><a href="http://www.barkah.org" target="_blank" rel="nofollow">www.barkah.org</a>
Ade Barkah
Ranch Hand

Joined: Mar 17, 2004
Posts: 65
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

Joined: Mar 17, 2004
Posts: 65
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

Joined: Mar 17, 2004
Posts: 65
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

Joined: Oct 14, 2002
Posts: 8801
    
    5
Good catches Ade - noted, thanks!


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Septimiu Pelau
Greenhorn

Joined: Feb 16, 2007
Posts: 8
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


_ ____ _ <br />Regards,<br />Septimiu
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8801
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt K&B SCJP 5 pg. 440 File Creation
 
Similar Threads
FileWriter and FileOutputStream:confused:
java.io.package
I found something wrong form K&B chapter 6
Doubt on Load on startup tag and Meta-inf
Barry Boone (BB) Q38 FileOutputStream