Forums Register Login

Null Pointer Exception with File I/O and Scanner

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
bacon. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1733 times.
Similar Threads
code not deleting txt file and renaming new txt file
check values in a csv file in all files in a directory
Head First Java QuizCardBuilder not saving files correctly
file search using scanner
Get filename while reading csv file
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:31:26.