关于 FileInputStream 的问题
import java.util.Properties;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class inout {
public inout() {
}
public static void main(String[] args) throws FileNotFoundException,
IOException {
inout inout = new inout();
Properties setupfile = new Properties();
FileInputStream fis = new FileInputStream("2.txt");
setupfile.load(fis);
}
}
我在硬盘(d)上建立了一个D:\2.txt 文件
程序运行之后就出错。
错误如下:
Exception in thread "main" java.io.FileNotFoundException: 2.txt (指定されたファイルが見つかりません。)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at get.picture.from.panel.inout.main(inout.java:16)
Debug之后的错误:
Hit uncaught exception java.io.FileNotFoundException