Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b5uFE41EgmSXEP4axJ
13 lines
406 B
Java
13 lines
406 B
Java
// JEP 513 allows statements before super(), but not anything that reads `this`.
|
|
public class ThisBeforeSuper {
|
|
static class Base { Base() {} }
|
|
static class Child extends Base {
|
|
int side = 4;
|
|
String describe() { return "child"; }
|
|
Child() {
|
|
System.out.println(describe()); // instance method call before super(): rejected
|
|
super();
|
|
}
|
|
}
|
|
}
|