Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
关于标准输入/输出,System 类的结构/设计如何?
System 类有一个公共的 finalout方法,它返回一个PrintStream. 该println()方法是嵌套方法还是如果我调用它究竟是如何工作的System.out.println();?
out
PrintStream
println()
System.out.println();
out是一个public static final变量,因为它是静态的,所以可以得到outas System.out(即以静态方式)。
public static final
System.out
out是一个PrintStream包含该方法的println()方法,并且您正在从(即,从)访问该println()方法。PrintStreamout