Difference between Abstract Class and Interface in C#

Abstract Class Interface
Using Abstract we can not achieve multiple inheritance using an Interface we can achieve multiple inheritance
An abstract class can have abstract as well as non-abstract members In an Interface all the members are implicitly abstract and must be overridden in the derived class.
An abstract class can have fields and constrants defined No fields can be defined in interfaces
An abstract class can contain access modifiers In Interface we can’t defined keyword static virtual, abstract or sealed.

When to Use abstract class and Interface?

  • If you anticipate creating multiple versions of your component, create an abstract class.
  • If the functionality you are creating will be useful across a wide range of disparate objects, use an interface. Abstract classes should be used primarily for objects that are closely related, whereas interfaces are best suited for providing common functionality to unrelated classes.
  • If you are designing small, concise bits of functionality, use interfaces. If you are designing large functional units, use an abstract class.
  • If you want to provide common, implemented functionality among all implementations of your component, use an abstract class. Abstract classes allow you to partially implement your class, whereas interfaces contain no implementation for any members.

C# - Frequently Asked Interview Questions