标准输入、输出流

1、System 类

public final static InputStream in = null;
public final static PrintStream out = null;
  标准输入、输出流 编译类型 运行类型 默认设备
System.in 标准输入 InputStream BufferedInputStream 键盘
System.out 标准输出 PrintStream PrintStream 显示器

2、打印流

(1)只有输出流:PrintStream、PrintWriter

(2)没有输入流

3、PrintStream

(1)默认输出位置:显示器

(2)System 类的 setOut 方法,修改打印流的输出位置

public static void setOut(PrintStream out) {
    checkIO();
    setOut0(out);
}

(3)print 方法底层为 write 方法

4、PrintWriter,扩展 Writer,用法与 PrintStream 相似

posted @   半条咸鱼  阅读(32)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
点击右上角即可分享
微信分享提示