Challenge 3: A Record Attempting to Extend a Class — Possible Solution ==================================================================== Broken attempt — NamedThing.java: public class NamedThing { protected String name; public NamedThing(String name) { this.name = name; } } Broken attempt — LabeledPoint.java: public record LabeledPoint(int x, int y) extends NamedThing { // attempting to extend a regular class from a record } Representative compile error: LabeledPoint.java:1: error: no interface expected here public record LabeledPoint(int x, int y) extends NamedThing { ^ 1 error Explanation: Every record implicitly extends java.lang.Record already -- this happens automatically the moment the record keyword is used, with no way to opt out of it. java1-5 established that a class can extend exactly one other class; java.lang.Record has already permanently filled that single slot for every record that exists, before the programmer ever gets a say. There is no syntax that lets a record additionally extend NamedThing or any other regular class -- the compiler rejects it immediately, not because of some arbitrary restriction, but because the single-inheritance slot genuinely has no room left. A record CAN still implement any number of interfaces (as shown earlier in the chapter, e.g. `record Circle(...) implements Shape`), since implements has no such cap. WHY THIS WORKS AS AN ANSWER ------------------------------ This reproduces the exact restriction the chapter's warn-box states -- a record cannot extend a class -- and the explanation correctly ties it back to java1-5's single-inheritance rule combined with the fact that java.lang.Record already occupies that one slot for every record.