public class NewClass1 {
public static void main(String[] args) throws FileNotFoundException {
String datasetFile = args[0];
BufferedReader in = new BufferedReader(new FileReader(datasetFile));
}
}
它产生了以下错误
Exception in thread "main" java.io.FileNotFoundException: abc (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)
at java.io.FileReader.<init>(FileReader.java:58)
at JavaApplication.NewClass1.main(NewClass1.java:29)
我应该用这段代码替换它吗?
BufferedReader out = new BufferedReader(new
InputStreamReader(System.in));
String input = out.readLine();