标签:java 读取 txt
java读取txt文件源码如下,仅是最简略版本:
package p1; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; public class readTXT { public static void main(String[] args) throws IOException { String filePath = "F:\\TxtTest.txt"; FileInputStream fis = new FileInputStream(filePath); InputStreamReader isr = new InputStreamReader(fis); BufferedReader br = new BufferedReader(isr); String line; for (;(line=br.readLine())!=null;) { System.out.println(line); } br.close(); isr.close(); fis.close(); } }
标签:java 读取 txt
原文地址:http://smileyes.blog.51cto.com/6027700/1626420