fork download
  1. class A {
  2. static {
  3. System.out.println("A: Static init");
  4. }
  5. }
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println("Pre");
  13. A a, b, c;
  14. b = null;
  15. System.out.println("Mid");
  16. a = new A();
  17. System.out.println("Post");
  18. }
  19. }
Success #stdin #stdout 0.08s 380160KB
stdin
Standard input is empty
stdout
Pre
Mid
A: Static init
Post