例如: FileWriter fw = new FileWriter(“mytest.txt”); BufferedWriter bw = new BufferWriter(fw); 为什么要两个一起new,new一个BufferedWriter对象不行吗?
Raelovejava
浏览 1329回答 1
1回答
四无小青年
/**
* Creates a buffered character-output stream that uses a default-sized
* output buffer.
*
* @param out A Writer
* BufferedWriter的构造方法需要一个Writer对象作为参数
*/
public BufferedWriter(Writer out) {
this(out, defaultCharBufferSize);
}望采纳