This is the first of three sections on network programming in Java. In this section we cover the basics of creating client sockets to connect to existing servers, and we also take an aside to summarize the basic ways of formatting data to send over the socket (i.e., calling printf) and reading the results (i.e., using StringTokenizer and String.split on the result of readLine). The second networking section covers servers and multithreaded networking apps; the third section covers the use of ObjectInputStream and ObjectOutputStream to send complex data structures across the network.
See http://courses.coreservlets.com/Course-Materials/java.html for the complete tutorial series (Programming with Java 8) and associated code. That site also lets you download PDF files of each lecture for saving or printing, and includes exercises and exercise solutions for each of the topics.