import java.io.*; import java.net.*; import java.util.Scanner; public class MathClient extends Client { public MathClient(String host, int port) { super(host, port); } protected long sendMessage(int x) { // write to the output stream out.write(x + "\n"); out.flush(); // get the response from the input stream long response = in.nextLong(); // done! return response; } }