Java 实例 - 读取文件内容
Java 教程
· 2019-02-10 20:12:27
以下实例演示了使用 readLine() 方法来读取文件 test.log 内容,其中 test.log 文件内容为:
码农教程 www.codercto.com
java 代码如下:
Main.java 文件
import java.io.*;
public class Main {
public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader("test.log"));
String str;
while ((str = in.readLine()) != null) {
System.out.println(str);
}
System.out.println(str);
} catch (IOException e) {
}
}
}
以上代码运行输出结果为:
码农教程 www.codercto.com null
点击查看所有 Java 教程 文章: https://codercto.com/courses/l/12.html
Two Scoops of Django
Daniel Greenfeld、Audrey M. Roy / CreateSpace Independent Publishing Platform / 2013-4-16 / USD 29.95
Two Scoops of Django: Best Practices For Django 1.5 is chock-full of material that will help you with your Django projects. We'll introduce you to various tips, tricks, patterns, code snippets, and......一起来看看 《Two Scoops of Django》 这本书的介绍吧!