Java 读取文件 在上一章中,您学习了如何创建和写入文件。 在下面的示例中,我们使用Scanner类来读取我们在上一章中创建的文本文件的内容: import java.io.File; // Import the File class import java.io.FileNotFoundException; // Import this class to handle errors import java.util.