Using methods covered in Chap. 2 , the above code may be adapted very easily to
produce a simple client–server application in which the server supplies personnel
details in response to client requests. The only difference is that, instead of sending
a series of strings from the server to the client(s), we shall now be passing an
ArrayList . Consequently, we shall not be making use of a PrintWriter object in our
server. Instead, we shall need to create an ObjectOutputStream object. We do this by
passing the OutputStream object returned by our server’s Socket object to the
ObjectOutputStream constructor, instead of to the PrintWriter constructor (as was
done previously).