Senior .Net Developer Question:
Download Questions PDF

Explain me what is the difference between an abstract class and an interface?

Answer:

An abstract class is always used as a base class. It provides some abstract/virtual members that the inheriting entities must implement, as well as a partial implementation for a functionality. For extra credit, job candidates might mention that this class can also declare fields. Developers cannot create an object from this class.

An interface, on the other hand, can declare properties, methods and events only (no access modifiers). The developer must implement all declared members. In short, an interface designates a contract/behavior that implementing classes should have.

Download Senior .Net Developer Interview Questions And Answers PDF

Previous QuestionNext Question
What is the Single Responsibility Principle?Explain me what is a design pattern and what is it for?