In http://docs.oracle.com/javase/tutorial/networking/sockets/readingWriting.html
To send data through the socket to the server, the EchoClient example needs to write to the PrintWriter. To get the server's response, EchoClient reads from the BufferedReader object stdIn, which is created in the fourth statement in the try-with resources statement
The second sentence should be "To get the server's response, EchoClient reads from the BufferedReader object in, which is created in the third statement in the try-with resources statment"
This is because the stdIn object is used for reading the input from the standard-input, while the in object is used to read from the socket.
Also fix the preceding paragraph:
The second statement in the try-with resources statement gets the socket's output stream and opens a PrintWriter on it. Similarly, the third statement gets the socket's input stream and opens a BufferedReader on it. The example uses readers and writers so that it can write Unicode characters over the socket.
To send data through the socket to the server, the EchoClient example needs to write to the PrintWriter. To get the server's response, EchoClient reads from the BufferedReader object stdIn, which is created in the fourth statement in the try-with resources statement
The second sentence should be "To get the server's response, EchoClient reads from the BufferedReader object in, which is created in the third statement in the try-with resources statment"
This is because the stdIn object is used for reading the input from the standard-input, while the in object is used to read from the socket.
Also fix the preceding paragraph:
The second statement in the try-with resources statement gets the socket's output stream and opens a PrintWriter on it. Similarly, the third statement gets the socket's input stream and opens a BufferedReader on it. The example uses readers and writers so that it can write Unicode characters over the socket.