本文主要是介绍[Java 12 IO] PrintStream 打印流 new PrintStream(new FileOutputStream(new File(/home。。,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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();}
}
这篇关于[Java 12 IO] PrintStream 打印流 new PrintStream(new FileOutputStream(new File(/home。。的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!