Skip to content

re: Why it is not possible to extend a final class in Java? VIEW POST


The creator of the class explicitly marked it that way because they did not want you to extend it. Probably to avoid having access to its protected members. But I can only guess as to their intentions. Generally, you have to use such a class with composition (create one and put it in a private field in your own class) rather than inheritance.

code of conduct - report abuse