packagechat;importjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.net.Socket;classClient{publicstaticvoidmain(Stringargv[])throwsException{Queueq=newQueue();// Thread that reads messages from stdin end queues themKeyboardThreadkt=newKeyboardThread(q);kt.start();SocketclientSocket=newSocket("localhost",6789);// Thread that reads messages from the queue and sends them to the serverToOtherUserThreadous=newToOtherUserThread(clientSocket,q);ous.start();BufferedReaderinFromServer=newBufferedReader(newInputStreamReader(clientSocket.getInputStream()));while(true){System.out.println("FROM SERVER: "+inFromServer.readLine());}}}