79278939

Date: 2024-12-13 16:19:01
Score: 1.5
Natty:
Report link

As of modern java versions, there are two new options to those that have already been offered.

  1. Records are a new way of defining classes which are immutable and final. They have been available since Java 16, however previews exist in 14 and 15 as well.
  2. Sealed classes allow you to white list certain classes to inherit interfaces and classes. The inheritors themselves can be final, sealed or open to inheritance according to your requirements. These are supported as of Java 17.
Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: J.Blake