Why We Can't Extend A Final Class In Java?

2

2 Answers

rahul Profile
rahul answered
Extension is used when you want to add new properties. So if you make a class final you don't want any new properties to be added. So a final class cannot be extended.
John Peter Profile
John Peter answered
We are using the final keyword before a class deliberately to prevent that class from inheritance. So we cannot extend that class

Answer Question

Anonymous