Writing a small data class by hand used to require 40 lines of private final fields, constructor, getters, equals, hashCode and toString. Modern Java (16+) condenses all of that into a single record declaration—and manages heap cleanup automatically through reachability-based garbage collection.
More lessons in Complete Core Java