public PrintWriter(OutputStream out,
boolean autoFlush)
Create a new PrintWriter from an existing OutputStream. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will convert characters into bytes using the default character encoding.Parameters:out - An output stream
autoFlush - A boolean; if true, the println() methods will flush the output buffer
boolean autoFlush)
Create a new PrintWriter from an existing OutputStream. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will convert characters into bytes using the default character encoding.Parameters:out - An output stream
autoFlush - A boolean; if true, the println() methods will flush the output buffer
解决方案 »
- Java面向对象编程,求一点是否在圆内……求改正!
- incompatible types;found:java.lang.Integer , required:int怎么解决?
- 求api的中文文档 最好代全文搜索的,在线等给分!
- 一个字符编码转换问题
- 前辈请指点一下
- Java类中关于继承的一点疑问
- 自定义一个包,调用的时候为什么不能用:import mypackge.*?如果指定import mypackage.Myclass;就行,为什么 ?
- 计算器
- 如何获取oracle某个表的字段?
- 请教各位对JAVA程序安装打包的经验之谈!
- constructor一题?????
- 求正式版或注册码:UltraEdit32 或EditPlus?
boolean autoFlush)
Create a new PrintWriter.Parameters:out - A character-output stream
autoFlush - A boolean; if true, the println() methods will flush the output buffer
//以上是PrintWriter的构造函数说明
PrintWriter out =new PrintWriter(new java.io.OutputStreamWriter (System.out),true);
new java.io.OutputStreamWriter (System.out):声明一个OutputStreamWriter
PrintWriter out =new PrintWriter(new java.io.OutputStreamWriter (System.out),true);是新建一个PrintWrite的对象,该对象基于System.out流。
因为new java.io.OutputStreamWriter 已经把这个路径都搞进来了,所以就可以不用c了,若改成
PrintWriter out =new PrintWriter(new OutputStreamWriter (System.out),true);
那就是需要a和c了!