[英]Standard in-/output stream
How is the System class structured/designed with regard to the standard in-/output? 关于标准输入/输出,如何构造/设计System类?
The System class has a public final out
method that returns a PrintStream
. System类具有公共的final
out
方法,该方法返回PrintStream
。 Is the println()
method then a nested method or how does that exactly work if I call System.out.println();
是
println()
方法然后是一个嵌套方法,或者如果我调用System.out.println();
该方法到底如何工作System.out.println();
? ?
out
is a public static final
variable, and since it's static, one can get out
as System.out
(ie in a static manner). out
是一个public static final
变量,由于它是静态的,因此可以作为System.out
out
(即以静态方式)。
out
is a PrintStream
which contains the println()
method, and you're accessing the println()
method from the PrintStream
(ie, from out
). out
是一个包含println()
方法的PrintStream
,并且您正在从PrintStream
(即,从out
)访问println()
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.