Java 17 – Sealed classes

Prior to Sealed Classes feature there were two ways a developer could prevent a class to be extended: 2. by making the class package private where no one outside the package can access the class and hence no one outside the package can extend the class. The first approach is very restrictive but the superclass … Read more

%d