Given a record `Point(int x, int y)`, which statement is true about the automatically generated constructor?
A compact constructor can perform validation or modification.
Why this answer
In Java records, you can define a compact constructor that omits the parameter list and allows you to modify the implicit parameters before they are assigned to the components. This is the only customization allowed for the canonical constructor; the compact constructor implicitly assigns the (possibly modified) parameters to the components at the end of its body.
Exam trap
The trap here is that candidates may think the compact constructor replaces the canonical constructor entirely, not realizing it still performs the implicit assignments, or they may confuse the compact constructor with a no-arg constructor or assume records have default constructors like regular classes.
How to eliminate wrong answers
Option B is wrong because records cannot have a no-arg constructor unless all components have default values, and even then you must explicitly define it; the automatically generated constructor always has the same signature as the record components. Option C is wrong because the automatically generated canonical constructor has the same access modifier as the record itself, which is public if the record is public, not package-private. Option D is wrong because the automatically generated constructor does not throw NullPointerException for null components; it simply assigns the value, and a NullPointerException would only occur later if you try to dereference a null component.