java.io.PrintStream (JDK 1.0)
This class is a FilterOutputStream that implements a number of methods for displaying textual representation of Java primitive data types. The print() methods output a standard textual representation of each data type. The println() methods do the same, and follow that representation with a newline. The methods convert various Java primitive types to String representations and then output the resulting string. When an Object is passed to a print() or println(), it is converted to a String by calling its toString() method.
PrintStream is the OutputStream type that makes it easiest to output text. As such, it is the most commonly used of the output streams. The System.out variable is a PrintStream.
Note that in Java 1.0 this class does not handle Unicode characters correctly--it discards the top 8 bits of all 16-bit characters, and thus works only with Latin-1 (ISO8859-1) characters. Although this problem has been fixed in Java 1.1, PrintStream has been superseded in Java 1.1 with PrintWriter. The constructors of this class have been deprecated, but the class itself has not, because it is still used by the System.out and System.err standard output streams.
PrintStream and its PrintWriter replacement output textual representations of Java data types. Use DataOutputStream to output binary representations of data.
public classPrintStreamextends FilterOutputStream { //Public Constructors# publicPrintStream(OutputStreamout); # publicPrintStream(OutputStreamout, booleanautoFlush); //Public Instance Methodspublic booleancheckError(); public voidclose(); //Overrides FilterOutputStreampublic voidflush(); //Overrides FilterOutputStreampublic voidb); public voidc); public voidi); public voidl); public voidf); public voidd); public voids); public voids); public voidobj); public voidprintln(); public voidprintln(booleanx); public voidprintln(charx); public voidprintln(intx); public voidprintln(longx); public voidprintln(floatx); public voidprintln(doublex); public voidprintln(char[]x); public voidprintln(Stringx); public voidprintln(Objectx); public voidwrite(intb); //Overrides FilterOutputStreampublic voidwrite(byte[]buf, intoff, intlen); //Overrides FilterOutputStream//Protected Instance Methods1.1 protected voidsetError(); }
Hierarchy:
Object->OutputStream->FilterOutputStream->PrintStream
Passed To:
Component.list(), Container.list(), Properties.list(), System.setErr(), System.setOut(), Throwable.printStackTrace()
Type Of:
System.err, System.out