1 // Test to make sure static initializers are called 2 3 class bar 4 { 5 public static int zog; 6 public static int zag; 7 8 static 9 { 10 zog = 12; 11 zag = 2; 12 } 13 bar()14 public bar() { } 15 } 16 17 public class StaticConstructor 18 { foo()19 static int foo () 20 { 21 return new bar().zog; 22 } 23 main(String args[])24 public static void main(String args[]) 25 { 26 System.out.println ("" + (foo() + bar.zag)); 27 } 28 } 29 30