Understanding of Java PrintStream

Source: Internet
Author: User

PrintStream is actually a kind of filteroutputstream

public class PrintStream extends Filteroutputstream implements Appendable, closeable

Directly known subclasses:

LogStream is obsolete. No alternative version

PrintStream

Public PrintStream (OutputStream out,

Boolean AutoFlush) to create a new print stream.

Parameters:

Out-the output stream to which the values and objects will be printed

Autoflush-boolean variable; If true, the output buffer is flushed whenever a byte array is written, one of the println methods is called, or a newline character or byte (' \ n ') is written

In addition to the filteroutputstream of Write,flush and other methods, is a big push of the Print method

Special PrintStream:

System. In ———— key is already open

public static final InputStream in "standard" input stream. This stream is open and ready to provide input data. Typically, this stream corresponds to keyboard input or another input source specified by the host environment or user.

Out

public static final PrintStream out "standard" output stream. This stream is open and ready to accept output data. Typically, this stream corresponds to the display output or another output target specified by the host environment or user.

Err

public static final PrintStream err "standard" error output stream. This stream is open and ready to accept output data.

Typically, this stream corresponds to the display output or another output target specified by the host environment or user

Understanding of Java PrintStream

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.