标签:nts div -- except throw out byte font text
<!--字符打印流-->
public class CharDemo {
public static void main(String[] args) throws Exception {
// 创建字符打印流
PrintWriter p = new PrintWriter(new FileWriter(new File("src/打印流_输出流/text.txt"), true));
p.print("黄伟强");
p.println();
p.print(345);
p.close();
}
}
<!--字节打印流-->
public class ByteDemo {
public static void main(String[] args) throws Exception {
// 创建字节打印流
PrintStream p = new PrintStream(new FileOutputStream(new File("src/打印流_输出流/text.txt"), true));
p.print("黄");
p.println();
p.print(123);
p.close();
}
}
标签:nts div -- except throw out byte font text
原文地址:http://www.cnblogs.com/lovling/p/6308657.html