Can An Abstract Class Be Final


  • 16 Oct, 2012

    For abstract classes compolsory we should create child class to provide implementation , Butfinal classes we cann't create child class hence abstract-final combination is Illigal for classes....

    final classes cann't contain abstract methods,where as abstract class can contain final methods....

    abstract methods should be overridden in child classes to provide Implementation where as final methods cannot be overridden,hence abstract final combination is illigal for methods...

    Comments Received:
    Please give your suggestions and feedback:
  • 7 Aug, 2012

    abstract classese contains methods with no definition(abstract methods). These methods are to be implemented by a class which extends this abstract class. However final classes cannot be inherited. Hence a class cannot be both final and abstract.

    Comments Received:
    Please give your suggestions and feedback:
  • 21 Jul, 2012

    If you declare a class as final you can not extend that class.

    Comments Received:
    Please give your suggestions and feedback:
  • 16 Mar, 2012

    Java compiler slaps you if you declare abstract class as final. Infact no one in this world needs both applied at a time.  let me explain.

    Abstract class means it contains either abstract methods or not but if you declare a class as abstarct you can not create objects for that class.

    If you declare a class as final you can extend that class. so if you declare both at a time then no use of that class. thats why java wont allow both at a time.

    Comments Received:
    Please give your suggestions and feedback:
  • 29 Dec, 2011

    An abstract class may not be declared as final.

    Comments Received:
    raj: can you explain why
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.