Your code works for me. It prints one line with all the file's lines in it.
Can you copy the console for when you execute the program and paste it here?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
You have not shown what is in the file. Is the program working correctly now?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Are you sure that is the file? Can there be another one with the same name and different data?
Like:
TestingScanner
1012.2
one
true
two
false
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
The code works for me so I assume that you are having problems connecting to the file to be read.
How are you executing the program? Where is the file that you are trying to read?
To see the full path to the file where your program is trying to read the file, create a File object for the file and print out the absolute path to that file object. See the File class's API doc for the correct spelling of the method that returns the File's absolute path.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16