What is the difference between abstract and final classes?

Questions by kalaijavatest

Showing Answers 1 - 9 of 9 Answers

Roshan

  • Jul 13th, 2007
 

An abstract class cannot be instantiated whereas a final class cannot be extended.

Abstract class cannot be instantiated because the methods declared in it should be given implementation.

Final class cannot be extended because it's like contant variables which cannot be further implemented or declared.we cannot override the class.

1. Abstract class cannot be instatianted.But final class can be instatiated.
2. Abstract class must be etended. But final class cannot be extended.
3. If we declare class as final,then that class cannot contain abstract methods.
?? If we declare class as abstract,then that class can contain final methods.

  Was this answer useful?  Yes

sampra

  • Feb 14th, 2008
 

Abstrct class has some method who has no body so we cant create object for that whaere as fianal class is lik constant class we cant change the class ie we cant extend the final class so if we have to make anny class as immutable then declare class as final

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions