Note: PrintStream() is deprecated.As of JDK 1.1, the preferred way to print text is
via the PrintWriter class. Consider replacing code of the
form PrintStream p = new PrintStream(out);
with PrintWriter p = new PrintWriter(out);
Create a new print stream.
Parameters:
out - The output stream to which values and objects will be
printed
PrintStream
public PrintStream(OutputStream out,
boolean autoFlush)
Note: PrintStream() is deprecated.As of JDK 1.1, the preferred way to print text is
via the PrintWriter class. Consider replacing code of the
form PrintStream p = new PrintStream(out, autoFlush);
with PrintWriter p = new PrintWriter(out, autoFlush);
Create a new PrintStream.
Parameters:
out - The output stream to which values and objects will be
printed
autoFlush - A boolean; if true, the output buffer will be flushed
whenever a line is terminated or a newline character
('\n') is written
Flush the stream and check its error state. Errors are cumulative;
once the stream encounters an error, this routine will continue to
return true on all successive calls.
Returns:
True if the print stream has encountered an error, either on the
underlying output stream or during a format conversion, otherwise false.
Write a byte, blocking if necessary. If the character is a newline and
automatic flushing is enabled, the stream's flush method
will be called.
Note that the byte is written as given; to write a character that
will be translated according to the platform's default character
encoding, use the print(char) or println(char)
methods.
Print a boolean value. If the given value is true, then the string
"true" is written to the underlying output stream;
otherwise, the string "false" is written.
Print a floating-point number. The string printed is the same as that
returned by the toString method of the Float
class when invoked on the given float value.
Print a double-precision floating-point number. The string printed is
the same as that returned by the toString method of the
Double class when invoked on the given double
value.
Print a string. If the argument is null, the string
"null" is written to the underlying output stream.
Otherwise, the string's characters are converted into bytes according to
the platform's default character encoding.
Finish the current line by writing a line separator. The line
separator string is defined by the system property
line.separator, and is not necessarily a single newline
character ('\n').