Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavarecords and compact constructorsSingle-choice MCQ

Which non-canonical (alternate) constructor in a record compiles?

record Frac(int num, int den) { // A Frac(int whole) { this.num = whole; this.den = 1; } // B Frac(int whole) { this(whole, 1); } }