What's the meaning of System.out.println in Java?

后端 未结 19 820
谎友^
谎友^ 2020-11-27 11:49

Is this static println function in out class from System namespace?

namespace System {
  class out {
    static println ...         


        
19条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 12:21

    No. Actually out is a static member in the System class (not as in .NET), being an instance of PrintStream. And println is a normal (overloaded) method of the PrintStream class.

    See http://download.oracle.com/javase/6/docs/api/java/lang/System.html#out.

    Actually, if out/err/in were classes, they would be named with capital character (Out/Err/In) due to the naming convention (ignoring grammar).

提交回复
热议问题