1

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.

Prasad Kharkar
  • 13,410
  • 5
  • 37
  • 56
user3066213
  • 101
  • 2
  • 2
  • 5

1 Answers1

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