Abstract Class vs Interface

Comparison

FeatureAbstract classInterface
Instantiate directlynono
Constructor / state (backing fields)yesno
Default (non-abstract) functionsyesyes
How many can a class extendonemany
Members open by defaultonly abstract onesyes
Typical useshared base with state (BaseActivity, Account)capabilities / contracts (Clickable, Repository)

Rule of Thumb

  • Start with an interface. It keeps classes flexible and easy to fake in tests.
  • Use an abstract class when subclasses must share state or constructor logic.
  • A class can do both: class Savings : Account("x"), Printable, Exportable.