为什么System.out.print导致自动刷新? [英] Why does System.out.print cause autoflush?

查看:127
本文介绍了为什么System.out.print导致自动刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.out是一个PrintStream对象。我阅读了有关PrintStream的文档。我不明白为什么System.out.print导致缓冲区被刷新?

System.out is a PrintStream object. I read the documentation on PrintStream. What I don't get is why System.out.print causes the buffer to be flushed? Shouldn't that happen only for println?

推荐答案


那不是只发生在println吗?

Shouldn't that happen only for println?

Javadoc不会说何时刷新 。并且说刷新到 println() 或换行符上。

The Javadoc doesn't say when it won't be flushed. And it says it will be flushed on a println() or a newline.

这篇关于为什么System.out.print导致自动刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆