📜  如何检查文件是否剩余而不从中读取java代码示例

📅  最后修改于: 2022-03-11 14:52:20.983000             🧑  作者: Mango

代码示例1
Scanner scanner = new Scanner(new File("filename"));
while (scanner.hasNextLine()) {
   String line = scanner.nextLine();
   // process the line
}