Input and Output in Java is done by streams. Stream is an abstract entity which either creates information or eats it. Streams are device independent. Streams are a part of the java.io package. There are two types of streams in Java: Byte Streams and Character streams. Java also uses many predefined streams such as System.out for standard output stream, System.in for standard input stream and System.err for standard error stream.