Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
We didn’t use PrintWriter in the last chapter, we used BufferedWriter. We have a choice here, but when you’re writing one String at a time, PrintWriter is the standard choice. And you’ll recognize the two key methods in PrintWriter, print() and println()! Just like good ol’ System.out.
Make a Socket connection to the server
Make a PrintWriter chained to the Socket’s low-level (connection) output stream
Write (print) something