Java核心代码例程之:ShowFileContent.java
2008-01-05 08:38:10 来源:WEB开发网核心提示:import java.io.*;// Read a file using BufferedReader.readLine()public class ShowFileContent{ public static void main(String args[]) throws Exception { FileReade
import java.io.*;
// Read a file using BufferedReader.readLine()
public class ShowFileContent
{
public static void main(String args[]) throws Exception
{
FileReader fr = new FileReader("c:/autoexec.bat");
BufferedReader br = new BufferedReader(fr);
String line = null;
while ((line = br.readLine()) != null)
System.out.PRintln(line);
br.close();
}
}
更多精彩
赞助商链接