Your snippet uses the BufferedReader associated with InputStreamReader to read aline from the standard input console and save it to a String string.
Bufferedreader
Read text from a character input stream by buffering characters to ensure that characters, arrays, and strings are read efficiently. You can specify a buffer size or use the default size. The default value is large enough for most purposes. In general, each read request made from Reader invokes a request for a corresponding read from a base character or byte stream. Therefore, it makes sense to wrap the BufferedReader around any Reader whose read () operations can be expensive, such as FileReaders and InputStreamReaders.
BufferedReader # ReadLine ()
Read a line of text. A line is considered to be completed by any of the lines ('\ n'), carriage return ('\ r') or carriage return, followed immediately by a line.
InputStreamReader
InputStreamReader is a bridge from byte streams to character streams: it reads bytes and decodes them into characters using the specified encoding. The encoding used may be specified by name or may be specified explicitly, or the default encoding of the platform may be adopted. Each call to one of the reading methods () of the InputStreamReader can result in reading one or more bytes from the underlying input / output stream. In order to efficiently convert bytes to characters, more bytes can be read ahead of the base stream than is necessary for the current read operation.
System
The System class contains several useful fields and methods of the class. It cannot be created.
The facilities provided by the System class include standard input, standard output, and error output streams; access to externally defined "properties"; file and library uploader; and a utility method for quickly copying part of an array.
System.in
"Standard" input stream. This stream is already open and ready for input. Typically, this stream corresponds to keyboard input or another input source specified by the host environment or user.
source share