title: Java how to respond to HttpExchange
body: <p>I am new to Java. I used write server in <code>Golang</code>. I need to send response to the <code>HttpExchange</code>. Here is my code:</p>
  
  <pre><code>public static void main(String[] args) throws IOException 
  {
    Server = HttpServer.create(new InetSocketAddress(8000),0);
    Server.createContext("/login", new SimpleHandler());
    Server.setExecutor(null);
    Server.start();
  }
  class SimpleHandler implements HttpHandler
  {
      @Override
      public void handle(HttpExchange request) throws IOException 
      {
       //Here I need to do like request.Response.Write(200,"DONE");
      }
  }
  </code></pre>