compact constructor
A record constructor written with no parameter list, used to check and tidy the values before they are stored.
A compact constructor is a canonical constructor declared without a parameter list; its body runs on the implicit parameters, which it may reassign, and the fields are assigned from them when the body completes.
Examples
record Range(int low, int high) { Range { if (low > high) throw new IllegalArgumentException(); } }
See also