Is it necessary for an abstract class to have at least one abstract method?
The subject of this post and the body ask two different questions:
The answer to #2 is definitively no.
The answer to #1 is subjective and a matter of style. Personally I would say yes. If your intent is to prevent a class (with no abstract methods) from being instantiated, the best way to handle this is with a private
protected
constructor, not by marking it abstract
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With