集册 Java实例教程 从FileWriter创建BufferedWriter

从FileWriter创建BufferedWriter

欢马劈雪     最近更新时间:2020-01-02 10:19:05

487
从FileWriter创建BufferedWriter
/**NowJava.com**/



import java.io.BufferedWriter;

import java.io.FileWriter;


public class testfilecreation {

public static void main(String[] args) {

  try

  {

    FileWriter fstream = new FileWriter("d:\\out.txt");

  

    BufferedWriter bufferedWriter = new BufferedWriter(fstream);

    bufferedWriter.write("Hello Java");

    //Close the output stream
    /**
     * 时 代 J a v a 公 众 号 - N o w J a v  a . c o m 提 供 
    **/

    bufferedWriter.close();

  }catch (
展开阅读全文