开发者

Stumped by FileNotFound exception

开发者 https://www.devze.com 2023-04-04 21:30 出处:网络
All I want to do is import data from a text file.The file exists at C:\\temp\\text.txt.However, I keep getting a file not found error.What the 开发者_StackOverflow社区heck am I doing wrong???

All I want to do is import data from a text file. The file exists at C:\temp\text.txt. However, I keep getting a file not found error. What the 开发者_StackOverflow社区heck am I doing wrong???

public static void main(String[] args) throws IOException {
    String mFilename = "C:\\temp\\text.txt";
    Scanner myDataStream = new Scanner(new File(mFilename));}


For the sake of giving this question an answer:

Googling brought up a case where someone had file extensions hidden and his file was actually text.txt.txt. Check if it's not your case.

You can display extensions in Windows 7 by going in Organize > Folder and search option > View and unchecking Hide extensions for known file types from any folder's menu.

0

精彩评论

暂无评论...
验证码 换一张
取 消