title: Java new Interface instance syntax - what's happening?
body: <p>What happens when you declare a new instance of an Interface as follows: </p>
  
  <pre><code>OnClickListener oc = new OnClickListener(){
      @Override
      public void onClick(View v){
           //Something
      }
  };
  </code></pre>
  
  <p>Where is the method <code>onClick</code> stored? Its got to be in some sort of class storage? Does this mean that this syntax creates an unnamed class and implicitly implements the OnClickListener interface to it? If so, how come you can assign different <code>OnClickListener</code> objects to each other? Surely as they are 'implicitly' different class types, this assignment of two different classes is impossible.</p>
  
  <p>Could someone explain?</p>