第1个回答 2014-11-02
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
public class Brdemo {
public static void main(String[] args) throws IOException {
FileInputStream fis
= new FileInputStream(
"src/day03/BrDemo.java");//要读的文件路径
InputStreamReader isr
= new InputStreamReader(fis);//字符流
BufferedReader br
= new BufferedReader(isr); //缓冲
String line = null;
while((line=br.readLine())!=null){//字符不等于空
System.out.println(line);//一行一行地输出
}
br.close();//关闭文件
}
}本回答被提问者和网友采纳