使用OutputStream向屏幕上输出内容

使用OutputStream向屏幕上输出内容


/**   
 * 使用OutputStream向屏幕上输出内容    
 */   

import java.io.*;

class hello {

    public static void main(String[] args) throws IOException {

        OutputStream out=System.out;

        try{

            out.write("hello".getBytes());

        }catch (Exception e) {

            e.printStackTrace();

        }

        try{

            out.close();

        }catch (Exception e) {

            e.printStackTrace();

        }

    }

}

【运行结果】:

hello

posted @ 2018-10-01 01:02  尐鱼儿  阅读(1191)  评论(0编辑  收藏  举报