Stream definition

前端 未结 6 830
长发绾君心
长发绾君心 2021-02-05 11:01

I\'m reading on Java I/O streams and I\'m confused on the correct definition associated with them.

  • Some say that a stream is a sort of conveyor belt in which data
6条回答
  •  [愿得一人]
    2021-02-05 11:37

    In my viewpoint stream is actually a conveyor belt as you mention in the first point. Actually there are two types of stream, input, and output. An input stream is used to read the data from the input device like keywords and write that data to the files and output stream is used to read data from the disks, files, etc and write that data to the output device like console, monitor, etc.

    In a simple way, it is the bridge that helps to transport things from one point to another.

提交回复
热议问题