title: What is difference between .sendText() and System.out.println in websockets api
body: <p>I'm beginner of java HTML5 websockets api.<br></p>
  
  <p>I came across the following,Can any one please tell to me what is difference between <br></p>
  
  <p><code>session.getBasicRemote().sendText("Hello");</code></p>
  
  <p>and  </p>
  
  <pre><code>System.out.println(hello);
  </code></pre>
  
  <p>code is:</p>
  
  <pre><code>@OnOpen
  public void onOpen(Session session) {
      System.out.println("Connected to endpoint: " + session.getBasicRemote());
      try {
          session.getBasicRemote().sendText("Hello");
      } catch (IOException ex) {
      }
  }
  
  @OnMessage
  public void onMessage(String message) {
      System.out.println(message);
  }
  </code></pre>
  
  <p>Thanks for any help.</p>