aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes I found something wrong form K&B chapter 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "I found something wrong form K&B chapter 6" Watch "I found something wrong form K&B chapter 6" New topic
Author

I found something wrong form K&B chapter 6

Jack Crifer
Greenhorn

Joined: May 18, 2008
Posts: 29
In Working with Files and Directories

Create a Reader or a Writer or a Stream. Specifically, create a FileReader, a FileWriter, a PrintWriter, a FileInputStream, or a FileOutputStream. Whenever you create an instance of one of these classes, you automatically create a file, unless one already exists, for instance



I think just like FileInputStream,FileReader ,those INPUT funtion never created any file which is not exist.
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Be careful when putting something like this up, I have done that many times and most usually it results in wasted time. If you can show us the code that fails to createFile(), we can run the tests that duplicate the failure.

Be sure to run it several times before showing us.


"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Given just the quote you've shown, without any context, you are absolutely right. Constructing a FileReader or FileInputStream will never create a new file. Check the errata page for the book -- this is most likely a known issue.


[Jess in Action][AskingGoodQuestions]
Jack Crifer
Greenhorn

Joined: May 18, 2008
Posts: 29
Hi,Ernest. where I can get the errata table for the book.

Best Regards.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8883
    
    5
You can find the link to the errata page at the top of this very forum


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I found something wrong form K&B chapter 6