packagesums;importjava.io.*;importjava.net.*;publicclassServerThreadextendsThread{privateSocketconnectionSocket=null;privateBufferedReaderinFromClient;privateDataOutputStreamoutToClient;// the constructor argument is an established socketpublicServerThread(Sockets){connectionSocket=s;try{inFromClient=newBufferedReader(newInputStreamReader(connectionSocket.getInputStream()));outToClient=newDataOutputStream(connectionSocket.getOutputStream());}catch(IOExceptione){e.printStackTrace();}}publicvoidrun(){StringnumbersString;String[]numbersArray;floatsum;try{numbersString=inFromClient.readLine();numbersArray=numbersString.split(" ");sum=Float.parseFloat(numbersArray[0])+Float.parseFloat(numbersArray[1]);outToClient.writeBytes(sum+"\n");connectionSocket.close();}catch(IOExceptione){e.printStackTrace();}}}