File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes write to console after writing to file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "write to console after writing to file" Watch "write to console after writing to file" New topic

write to console after writing to file

Charity Burns

Joined: Aug 05, 2012
Posts: 1
I wrote my data to a file but I seem to be having an issue reading the file and then writing it to the console. I'm thinking my file is not integers like I think they are so maybe the next int is not working because of it. But basically I'm not getting anything on the console when I run it.
Greg Brannon

Joined: Oct 24, 2010
Posts: 563
Have you looked at the resulting data file, golfScores.txt? That might give you some hints.

You might also investigate whether the while loop condition,

while (input.hasNextInt()){

is evaluating to true so that the code in the block runs.

Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
I agree. Here's the link:
subject: write to console after writing to file
It's not a secret anymore!