title: Java : static keyword in middle of class
body: <p>Here is example code:</p>
  
  <pre><code>class A {
  
     static {
         int a;
         class B {
         }
     }
  
     public static void main(String[] args){
         // cannot access class B and in a;
     }
  }
  </code></pre>
  
  <p>I don't know what the <code>static</code> keyword in this context means. I declare an <code>int</code> variable and a class inside it. But I cannot use it inside class A or in the main method. I compile and it doesn't produce any errors. So, I think this type of declaration has some purpose. </p>