title: Can we print a java message on console without using main method, static variable and static method?
body: <pre><code>public class Test {
  
  /**
   * @param args
   */
  
  // 1st way
  public static void main(String[] args) {
      // TODO Auto-generated method stub
      System.out.println("Test....!!!!!");
  }
  
  // 2nd way
  static{
  System.out.println("Test....!!!!!");
  System.exit(1);
  }
  
  // 3rd way
  private static int i = m1();
  public static int m1(){
      System.out.println("Test...!!!!");
      System.exit(0);
      return 0;
  }
  </code></pre>
  
  <p>Other than this, can we print message any other way.</p>