title: What does `someObject.new` do in Java?
body: <p>In Java, I have just found out that the following code is legal:</p>
  
  <pre><code>KnockKnockServer newServer = new KnockKnockServer();                    
  KnockKnockServer.receiver receive = newServer.new receiver(clientSocket);
  </code></pre>
  
  <p>FYI, receiver is just a helper class with the following signature:</p>
  
  <pre><code>public class receiver extends Thread {  /* code_inside */  }
  </code></pre>
  
  <p>I've never seen the <code>XYZ.new</code> notation before. How does that work?  Is there any way to code that more conventionally?</p>