Java PrintStream 打印流 new PrintStream(new FileOutputStream(new File("/home。。。package com.qunar.basicJava.javase.io;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
/**
* Author: libin.chen@qunar.com Date: 14-6-5 20:51
*/
public class PrintDemo01 {
public static void main(String[] args) throws FileNotFoundException {
PrintStream printStream = null;
printStream = new PrintStream(new FileOutputStream(new File("/home/hp/tmp" + File.separator + "test.txt")));
printStream.print("hello ");
printStream.println("world!!!!");
printStream.close();
}
}