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 streamSystem.in:
standard input streamSystem.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();
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.