title: How to send two strings through client to server using Socket in Java?
body: <p>Here my code (sends only single String)</p>
  
  <p>Client</p>
  
  <pre><code>Socket sock = new Socket("localhost",9999);    
  Scanner in = new Scanner(System.in);
  String msg;
  
  PrintStream pr = new PrintStream(sock.getOutputStream());
  
  System.out.print("Enter the Msg : ");
  msg = in.nextLine();
  
  pr.print(msg);
  </code></pre>
  
  <p>Server</p>
  
  <pre><code>ServerSocket ser = new ServerSocket(9999);
  Socket sock = ser.accept();
  
  BufferedReader br = new BufferedReader(new InputStreamReader(sock.getInputStream()));
  
  String msg = br.readLine();
  
  System.out.println("Received Msg : "+msg);
  </code></pre>
  
  <p>This Code Works Clearly. But I want to Send two strings through client to server.</p>