• Post Reply Bookmark Topic Watch Topic
  • New Topic

Null Pointer Exception with File I/O and Scanner  RSS feed

 
Jm Freeman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get a null pointer error on line 17 of the following fragment. I suspect it has to do with the way I am reading the file, but I'm unsure. I can provide more information or code if necessary. Thanks in Advanced.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37469
539
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This part is a problem:


You are reading from both the Scanner and the BufferedReader directly. That's going to confuse Java as to what you are up to. Can you try changing br.readLine() to get the next line from the scanner?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!