Why Can A Final Class Did Not Have Any Abstract Methods?


1 Answers

Anonymous Profile
Anonymous answered
The question refers to concepts from the Java programming language, created by Sun Microsystems.

In Java, a final class is a class which cannot be sub-classed. An abstract class is a class which is designed to be subclassed. It will contain abstract methods which are given only as method signatures with their implementations left to the derived subclasses.

If a class inherits from an abstract class, it must either implement the abstract methods or declare itself to be abstract too, deferring the implementation to a further sub-class. Since a final class cannot have any sub-class, this is the last opportunity for the abstract methods to receive their implementation - it cannot be deferred any further. Therefore a final class cannot contain any abstract methods.

Answer Question