DEV Community

Discussion on: Why it is not possible to extend a final class in Java?

Collapse
 
kspeakman profile image
Kasey Speakman

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.