+ 1
Can I define an abstract class without adding an abstract method?
A good example can be found in the decorator pattern, see here a WindowDecorator and CoffeeDecorator are abstract classes but neither includes an abstract method.
1 ответ
+ 7
Yes, you can. An abstract class can exist without abstract method, but an abstract method must be written within an abstract class.