OpenJDK proposal takes aim at verbose Java syntax

Records and sealed types would provide more compact syntax for declaring classes and a way to restrict subclasses, respectively

JDK proposal takes aim at verbose Java syntax
Getty Images

Java would gain records and sealed types capabilities as part of a draft JDK enhancement proposal intended to address complaints that Java is too verbose and requires too much “ceremony” code. The proposal was initiated by Brian Goetz, Java language architect at Oracle.

Records provide a compact syntax for declaring classes that are transparent holders for shallowly immutable data. Sealed types, meanwhile, offer a means for declaring classes and interfaces that can restrict their subtypes. Combined, these features are sometimes referred to as algebraic data types.