title: Static inner class extending abstract outer class in java
body: <p>I saw this pattern today and it confused me a lot:</p>
  
  <pre><code>abstract class A {
      // does something
  
      static class B extends A {
          // does something as well
      }
  }
  </code></pre>
  
  <p>Two weird things I found about it:</p>
  
  <ul>
  <li>Static class can be initialised using <code>new A.B()</code>.</li>
  <li>Static class is not unique in the application (therefore, not really static), as each initialisation creates a new object.</li>
  </ul>
  
  <p>I am still perturbed as to why to use such a pattern? And does <code>static class</code> in this context mean, that you can access it's constructors statically, without needing to create an instance of <code>A</code>, but not really it being a unique in any way in the app?</p>
  
  <p>EDIT:</p>
  
  <p>OK, so I think my understanding of static classes came from C#. I am clear on the staticness of java classes now. But <strong>when would you use such a pattern</strong> (where inner static class is extending outer abstract one) <strong>and why</strong>?</p>