当前位置: 代码迷 >> 综合 >> [Java 12 IO] PrintStream 打印流 new PrintStream(new FileOutputStream(new File(/home。。
  详细解决方案

[Java 12 IO] PrintStream 打印流 new PrintStream(new FileOutputStream(new File(/home。。

热度:10   发布时间:2023-12-14 08:42:53.0
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();}
}

  相关解决方案