title: How can an object be created from a static block?
body: <p>Consider two classes in a default package :</p>
  
  <pre><code>    class Trial {
          int a;
          int b;
  
          public static void main (String [] args){
              System.out.println("test base");
  
          }
  
  
      }
  
      public class TrialExe {
          int a;
          int b;
  
          public static void main (String [] args){
              Trial t = new Trial();
              System.out.println("test exe");
          }
  
  
      }       
  </code></pre>
  
  <p>Compiling TrialExe: 
      javac TrialExe </p>
  
  <p>How can this compile?. Considering that the Trial object is created from a static block, to create an object the constructor of Trial is required, but as far as I know we cannot access a non static method from a static method and the constructor is non static. </p>