0 LIKES LikeUnLike
I'm trying to read an external file into my application and below is what I roughly wrote. I checked around and it looks alright to me but the system just couldn't find the file I have allocated.inputFileName1 is the variable that will hold the file name when the user is asked to input them.I have a file called hello.txt (used for testing) under C:\ but apparently the system kept on saying IOException error that the file isn't there when it is down there!File file = new File("C:\\"+inputFileName1);Scanner fromFile1 = new Scanner(file);String var1 = fromFile1.next();System.out.println("This is from the file: "+var1);Anyone can help to solve this problem? Thanks! :S
Tags:
Report (0) (0) | earlier
Latest activity: earlier. This question has 1 answers.