返回信息流public class OutputStreamDemo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
OutputStream out=System.out;
try{
byte[] bs="本实例使用输出流,在控制台上输出字符串\n".getBytes();
out.write(bs);
bs="输出内容:\n".getBytes();
out.write(bs);
bs=" 明日科技".getBytes();
out.write(bs);
out.close();
}catch(IOException e){
e.printStackTrace();
}
}
}
会显示如下错误:Type mismatch: cannot convert from PrintStream to OutputStream
这是一条镜像帖。来源:北邮人论坛 / java / #12579同步于 2009/12/7
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖
一段小程序
zuoziji
2009/12/7镜像同步3 回复
订阅后,新回复会通过你的通知中心匿名送达。
3 条回复
【 在 ericyosho 的大作中提到: 】
: 加上
: import java.io.*;
: import java.util.*;
: ...................