使用BufferedReader读取文本文件
/* from 时代Java公众号 - N o w J a v a . c o m*/ package FilesManipulations; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class ReadTxt { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new FileReader( "testing.txt"))) { String sCurrentLine; while ((sCurrentLine = br.readLine()) != null) {/** n o w j a v a . c o m - 时代Java 提供 **/