In Java, Input and Output (I/O) are used to process the input and produce the output. This means an input stream can abstract many different input kinds: from a disk file, a keyboard, or a network socket. Likewise, an output stream may refer to the console, a disk file, or a network connection.