What are I/O classes in Java?


The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java. All these streams represent an input source and an output destination. The stream in the java.io package supports many data such as primitives, object, localized characters, etc.

A stream can be defined as a sequence of data. There are two kinds of Streams −

  • InputStream: The InputStream is used to read data from a source.
  • OutputStream: The OutputStream is used for writing data to a destination.

As described earlier, a stream can be defined as a sequence of data. The InputStream is used to read data from a source and the OutputStream is used for writing data to a destination.

Here is a hierarchy of classes to deal with Input and Output streams.


Swarali Sree
Swarali Sree

I love thought experiments.

Updated on: 25-Feb-2020

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements