Home Education Subscribe to RSS

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

Answer Question

1 Answer - Sort by: Date | Rating

    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.
    0 0

    Cian 

    answered 3 years ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International