javaboys

JAVA 文件操作

import java.io.*;

public class FileTest{
   public FileTest(){

}
try{
File f  = new File("d:\test.txt");
FileReader fr = new FileReader(f);
BufferedReader br  = new BufferedReader(fr);

String line = br.readLine();

while(line != null){
   System.out.println(line + "\n");

  line = br.readLine();
}

}catch(Exception ex){
    System.err.println(ex);
}
}

posted on 2007-03-31 17:29 javaboys 阅读(87) 评论(0)  编辑  收藏 所属分类: j2se


只有注册用户登录后才能发表评论。


网站导航: