【发布时间】:2018-12-08 05:19:48
【问题描述】:
package files;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.File;
public class file {
public static void main(String[] args)throws FileNotFoundException {
File file = new File("txtfile.txt");
Scanner input = new Scanner(file);
while (input.hasNextLine()) {
System.out.println(input.nextLine());
}
}
}
它说 file.txt 我必须输入完整的文件路径。我观看的所有教程都不必这样做。
【问题讨论】:
-
这也可能有助于回答您的问题:stackoverflow.com/questions/16313260/…
标签: java file path filenotfoundexception