1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
package test1; public class FieldInit { public static int counter = 0; public static int loop = 3; public static int get(Object obj) { System.out.println("FieldInit: get"); return ++counter; } public FieldInit() { do { --loop; } while (loop > 0); } }