Java 16 introduces a new language feature called Records. Records have been a part of Java 14 and 15 but were still in preview.
What is a Record?
Record is a new type of declaration to define immutable data classes.
It is used instead of class and allows to avoid the usual ceremony of creating
toString(), getters, and constructor.
For those who are familiar with Scala — it is similar to a case class, for those…