其他
Java教程-Java CharArrayWriter类
整理:Java面试那些事儿
Java CharArrayWriter类声明
public class CharArrayWriter extends Writer
Java CharArrayWriter类方法
专属福利
Method | Description |
CharArrayWriter类示例:
package cn.javatiku;
import java.io.CharArrayWriter;
import java.io.FileWriter;
public class CharArrayWriterExample {
public static void main(String args[])throws Exception{
CharArrayWriter out=new CharArrayWriter();
out.write("Welcome to javatiku");
FileWriter f1=new FileWriter("D:\\a.txt");
FileWriter f2=new FileWriter("D:\\b.txt");
FileWriter f3=new FileWriter("D:\\c.txt");
FileWriter f4=new FileWriter("D:\\d.txt");
out.writeTo(f1);
out.writeTo(f2);
out.writeTo(f3);
out.writeTo(f4);
f1.close();
f2.close();
f3.close();
f4.close();
System.out.println("Success...");
}
}
Success...
Welcome to javatiku
Welcome to javatiku
Welcome to javatiku
Welcome to javatiku
我就知道你会点赞+“在看”