当前页面: 开发资料首页 → Java 专题 → Java文件操作大全4:文件读取
Java文件操作大全4:文件读取
摘要: Java文件操作大全4:文件读取
</td>
</tr>
<tr>
<td height="35" valign="top" class="ArticleTeitle"> <%@ page contentType="text/html;charset=gb2312"%>
String path=request.getRealPath("/article/article5a/example/filetest");
//取得当前目录的路径
FileReader fr=new FileReader(path + "ReadData.txt");//建立FileReader对象,并实例化为fr
BufferedReader br=new BufferedReader(fr);//建立BufferedReader对象,并实例化为br
<table width="730" border="0">
<tr>
<td width="724">
</td>
</tr>
</table>
</td>
</tr>
<tr>