- Java.io - Writer
- Java.io - StringWriter
- Java.io - StringReader
- Java.io - StringBufferInputStream
- Java.io - StreamTokenizer
- Java.io - SerializablePermission
- Java.io - SequenceInputStream
- Java.io - Reader
- Java.io - RandomAccessFile
- Java.io - PushbackReader
- Java.io - PushbackInputStream
- Java.io - PrintWriter
- Java.io - PrintStream
- Java.io - PipedWriter
- Java.io - PipedReader
- Java.io - PipedOutputStream
- Java.io - PipedInputStream
- Java.io - OutputStreamWriter
- Java.io - OutputStream
- Java.io - ObjectStreamField
- Java.io - ObjectStreamClass
- io - ObjectOutputStream.PutField
- Java.io - ObjectOutputStream
- Java.io - ObjectInputStream.GetField
- Java.io - ObjectInputStream
- Java.io - LineNumberReader
- Java.io - LineNumberInputStream
- Java.io - InputStreamReader
- Java.io - InputStream
- Java.io - FilterWriter
- Java.io - FilterReader
- Java.io - FilterOutputStream
- Java.io - FilterInputStream
- Java.io - FileWriter
- Java.io - FileReader
- Java.io - FilePermission
- Java.io - FileOutputStream
- Java.io - FileInputStream
- Java.io - FileDescriptor
- Java.io - File
- Java.io - DataOutputStream
- Java.io - DataInputStream
- Java.io - Console
- Java.io - CharArrayWriter
- Java.io - CharArrayReader
- Java.io - ByteArrayOutputStream
- Java.io - ByteArrayInputStream
- Java.io - BufferedWriter
- Java.io - BufferedReader
- Java.io - BufferedOutputStream
- Java.io - BufferedInputStream
- Java.io - Home
Java.io package extras
Java.io package Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java.io.PrintStream Class
Introduction
The Java.io.PrintStream class adds functionapty to another output stream, the abipty to print representations of various data values conveniently.
Class declaration
Following is the declaration for Java.io.PrintStream class −
pubpc class PrintStream extends FilterOutputStream implements Appendable, Closeable
Field
Following are the fields for Java.io.PrintStream class −
protected OutputStream out − This is the output stream to be filtered.
Class constructors
Sr.No. | Constructor & Description |
---|---|
1 | PrintStream(File file) This creates a new print stream, without automatic pne flushing, with the specified file. |
2 | PrintStream(File file, String csn) This creates a new print stream, without automatic pne flushing, with the specified file and charset. |
3 | PrintStream(OutputStream out) This creates a new print stream. |
4 | PrintStream(OutputStream out, boolean autoFlush) This creates a new print stream. |
5 | PrintStream(OutputStream out, boolean autoFlush, String encoding) This creates a new print stream. |
6 | PrintStream(String fileName) This creates a new print stream, without automatic pne flushing, with the specified file name. |
7 | PrintStream(String fileName, String csn) This creates a new print stream, without automatic pne flushing, with the specified file name and charset. |
Class methods
Sr.No. | Method & Description |
---|---|
1 | This method appends the specified character to this output stream. |
2 | This method appends the specified character sequence to this output stream. |
3 | This method appends a subsequence of the specified character sequence to this output stream. |
4 | This method flushes the stream and checks its error state. |
5 | This method clears the internal error state of this stream. |
6 | This method closes the stream. |
7 | This method flushes the stream. |
8 | This method writes a formatted string to this output stream using the specified format string and arguments. |
9 | This method writes a formatted string to this output stream using the specified format string and arguments. |
10 | This method prints a boolean value. |
11 | This method prints a character. |
12 | This method prints an array of characters. |
13 | This method prints a double-precision floating-point number. |
14 | This method prints a floating-point number. |
15 | This method prints an integer. |
16 | This method prints a long integer. |
17 | This method prints an object. |
18 | This method Prints a string. |
19 | This is a convenience method to write a formatted string to this output stream using the specified format string and arguments. |
20 | This is a convenience method to write a formatted string to this output stream using the specified format string and arguments. |
21 | This method terminates the current pne by writing the pne separator string. |
22 | This method prints a boolean and then terminate the pne. |
23 | This method prints a character and then terminate the pne. |
24 | This method prints an array of characters and then terminate the pne. |
25 | This method prints a double and then terminate the pne. |
26 | This method Prints a float and then terminate the pne. |
27 | This method prints an integer and then terminate the pne. |
28 | This method prints a long and then terminate the pne. |
29 | This method prints an Object and then terminate the pne. |
30 | This method prints a String and then terminate the pne. |
31 | This method sets the error state of the stream to true. |
32 | This method writes len bytes from the specified byte array starting at offset off to this stream. |
33 | This method writes the specified byte to this stream. |
Methods inherited
This class inherits methods from the following classes −
Java.io.FilterOutputStream
Java.io.Object