使用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

相关文章:

  • 2021-04-10
  • 2021-12-08
  • 2021-10-31
  • 2022-12-23
  • 2021-05-12
  • 2021-08-08
  • 2022-12-23
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2021-10-17
  • 2022-01-24
相关资源
相似解决方案