• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Will FileReader create a new file?

 
Benjamin Samuel
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K&B Book states that

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...


But when I create an instance of FileReader, i get a FileNotFoundException if the file does not exist before. Code follows:

 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, this is a bug in the book. Search this forum for topics that discuss this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic