import java.util.List; class A { int i; A() { this.i++; // Error this.hashCode(); // Error System.out.print(this); // Error super(); } A(int i) {} } class B extends A { B() { int i = 3; super(); } B(int i) { this(); super(2); } B(char i) { super(4); this(); } B(String s) { try { super(2); } finally { } } B(String s, int i) { { super(2); } } B(boolean b, int i) { if (false) return; super(i); } void f() { super(); } void g() { this(); } } class D { int i; } class E extends D { E() { super.i++; // Error super(); } } class F { int i; F() { i++; // Error hashCode(); // Error super(); } } class G { int b; class C { int c; C() { G.this.b++; // Allowed - enclosing instance C.this.c++; // Error - same instance super(); } } } class Outer { void hello() { System.out.println("Hello"); } class Inner { Inner() { hello(); // Allowed - enclosing instance method super(); } } } class Outer2 { class Inner { } Outer2() { new Inner(); // Error - 'this' is enclosing instance super(); } } class X { class S { } X() { var tmp = new S() { }; // Error super(); } } class O { class S { } class U { U() { var tmp = new S() { }; // Allowed super(); } } } class Y { Y(Object o) { if (o == null) throw new NullPointerException(); super(); } } class Z extends Y { Z() { super(this); // Error - refers to 'this' } Z(List list) { super((T)list.get(0)); // Allowed - refers to 'T' but not 'this' } } record R(int x, int y) { R(int x, int y, int z) { if (z > 1000) throw new IllegalArgumentException(); this(x, y); } } enum EE { A, B; EE() { System.out.println(1); this(1); } EE(int i) {} }