In Java, is 'new' a type of function?
<p>My apologies if this is a silly question. In Java, I 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 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 a way to code that in a more conventional way?</p>
