In the following example, the Emp abstract data class is being extended by the non-abstract Manager data class:
abstract record Emp(String name, int age); record Manager(String name, int age, String country) extends Emp(name, age);
When a non-abstract data class extends an abstract data class, it accepts all of the data in its header—the ones that are required for itself, and for its base class.
A data class can extend a single abstract data class.