3 ms·
- A class can only inherit from one abstract class, but can implement multiple interfaces. - An interface cannot have member variables.
by danieldk 14y ago
- A class can only inherit from one abstract class, but can implement multiple interfaces.
- An interface cannot have member variables.
- twic 14y agoAlso, an abstract class can have a constructor (and instance initializers, and initialization expressions for its fields), which an interface can't. That means an abstract class can do work when it is created. Although it's probably a good idea not to do too much work - a factory method would be better for that.