What is the difference between Interface and Abstract Class in C#?

1 Answers

Ravi Vishwakarma
Ravi Vishwakarma

Here are some of the common differences between an interface and an abstract class in C#.

  1. An abstract class can have non-abstract methods (concrete methods) while in case of interface, all the methods have to be abstract.
  2. An abstract class can declare or use any variables while an interface is not allowed to do so.
  3. In an abstract class, all data members or functions are private by default while in an interface all are public, we can’t change them manually.
  4. In an abstract class, we need to use abstract keywords to declare abstract methods, while in an interface we don’t need to use that.
  5. An abstract class can’t be used for multiple inheritance while the interface can be used as multiple inheritance.
  6. An abstract class use constructor while in an interface we don’t have any type of constructor.