can any one please explain the scenario when A class may be declared abstract even if it has no abstract methods. i have tried in many websites but i did not found it.Thanks a lot.
Asked
Active
Viewed 214 times
1
-
Which language do you use? – MusicLovingIndianGirl Jan 08 '14 at 10:10
-
I guess this link would help. http://www.thejavageek.com/2013/12/31/use-abstract-class-java/ – Prasad Kharkar Jan 08 '14 at 10:13
-
This might help too - http://stackoverflow.com/questions/18029919/use-of-abstract-class-if-class-does-not-include-any-abstract-method – MusicLovingIndianGirl Jan 08 '14 at 10:14
1 Answers
1
Broadly, this would be because the class provides concrete implementations of functionality but should not itself be instantiated. For example, an AbstractWidget in a price calculator may not be suitable to directly instantiate, but it has concrete implementations of certain widget functionality like being rearranged. The expectation is that the subclass adds new methods altogether, or overrides the ones already declared.

ehdv
- 4,483
- 7
- 32
- 47