Java 17 – Sealed classes
Prior to Sealed Classes feature there were two ways a developer could prevent a class to be extended: by declaring the class as final where no one can extend this class. 2. by making the class package private where no one outside the package can access the class and hence no one outside the package … Read more