What is the difference between System.out, System.in and System.err streams in Java?


All the programming languages provide support for standard I/O where the user's program can take input from a keyboard and then produce an output on the computer screen. Similarly, Java provides the following three standard streams:

  1. Standard Input: This is used to feed the data to user's program and usually a keyboard is used as a standard input stream and represented as System.in.
  2. Standard Output: This is used to output the data produced by the user's program and usually a computer screen is used for standard output stream and represented as System.out.
  3. Standard Error: This is used to output the error data produced by the user's program and usually a computer screen is used for standard error stream and represented as System.err.

Swarali Sree
Swarali Sree

I love thought experiments.

Updated on: 30-Jul-2019

856 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements