// Written with System.out so that JDK 21 can compile it: the ONLY thing wrong with it on 21 is the statement before super(...). public class OnJdk21 { static class Person { Person(String n) {} } static class Employee extends Person { Employee(String name, int salary) { if (salary < 0) throw new IllegalArgumentException("negative"); super(name.strip()); } } public static void main(String[] args) { new Employee(" a ", 1); System.out.println("constructed"); } }