Java I/O Tutorial
Java I/O (Input and Output) is used to take the input and give the output depending on the input.
Java has its own term stream in order to fetch I/O operation faster. The java.io package consists of all the classes required to have an input and output operations.
We can do file handling in java by JAVA IO API.
A stream is a collection of data in a particular sequence.In Java a stream consists of bytes.
In java, 3 streams are created for the user by default. All these streams are attached with console.
1) System.out: standard output stream
2) System.in: standard input stream
3) System.err: standard error stream
Java application makes the use of an output stream to write the given data to a destination, it can be anything like file,an array,peripheral device or socket.
Java application makes the use of an input stream to read the given data from a source, it can be anything like a file,an array,peripheral device or socket.
Example of output stream
Output : DONE
Example of Input stream
Output: Fan moves very fast