java.lang · java.base · since Java 16

Record

declaration
public abstract class Record

The implicit superclass of all record types. Mostly a marker in the hierarchy — the interesting machinery (canonical constructor, accessors, equals/hashCode/toString) is generated per record.

  • Records cannot extend anything else; they may implement interfaces
  • Class.isRecord() and getRecordComponents() expose the shape reflectively