Java Input and Output Handling - BunksAllowed

BunksAllowed is an effort to facilitate Self Learning process through the provision of quality tutorials.

Random Posts

Java Input and Output Handling

Share This

Java I/O stands for Input and Output. It uses stream concept to make I/O operation fast. The java.io package contains all the classes required for input and output operations (console and file based input/output).


Stream


A stream is a sequence of data. In Java, a stream is composed of bytes. There are three types of streams in Java, which are attached to the console.

  • System.out: standard output stream
  • System.in: standard input stream
  • System.err: standard error stream

Let us check the following example code for standard input, output, and error code.

System.out.println("This is a text message!");
System.err.println("This is an error message!");
String s = System.in.readLine();

Happy Exploring!

No comments:

Post a Comment