At the risk of repeating the facts that have already been noted, let me try to interpret the document a little differently ...
It seems that only with PrintBuffer the creation time (i.e. when calling the constructor) can AutoFlush behavior for PrintStream be configured.
In addition, as you indicated, the documentation states that when you call any of the various public PrintBuffer constructors without specifying the startup status, a non-automatic PrintStream will be created.
However, in the case of System.out, you do not invoke the constructor for PrintBuffer. The java.lang.System class creates an "out" PrintStream instance when the VM starts. This means that when you request a PrintStream object, which is stored in the System object in its drop-down field, you don’t know which constructor was called, and therefore there is no idea of the autostart state of the stream that will be passed to you when you ask for him.
I agree, it would be very nice if the doc for java.lang.System indicated that the stream contained in its "out" field has its autostart mode equal to true. But this is not a “requirement”, no more than I should document if JButton returned from my (hypothetical) myCrazyPanel.getTheChangeColorsButton () on or off. Yes, the default buttons but you cannot complain if JButton is disabled. The same thing here.
source share