package theatre; import java.io.*; import java.net.*; class Client { public static void main(String[] argv) throws Exception { String response; System.out.println("Booking a seat..."); Socket clientSocket = new Socket("localhost", 9876); BufferedReader inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); response = inFromServer.readLine(); if(response.equals("-1")) { System.out.println("NO AVAILABLE SEATS"); } else { System.out.println("RESERVED SEATS: " + response); } clientSocket.close(); } }