packagetheatre;importjava.io.*;importjava.net.*;classClient{publicstaticvoidmain(String[]argv)throwsException{Stringresponse;System.out.println("Booking a seat...");SocketclientSocket=newSocket("localhost",9876);BufferedReaderinFromServer=newBufferedReader(newInputStreamReader(clientSocket.getInputStream()));response=inFromServer.readLine();if(response.equals("-1")){System.out.println("NO AVAILABLE SEATS");}else{System.out.println("RESERVED SEATS: "+response);}clientSocket.close();}}