C# and .NET interview questions: -What is the differences between abstract class and interface?
C# and .NET interview questions: - What is the differences between abstract class and interface?
|Implementation||Some methods in abstract classes can have implementation.||All methods, function, properties in interfaces have to empty compulsorily.|
|Scenario||Abstract classes are used when we want to share common functionality in parent child relationship.||Interfaces are used to define contract, enforce standardization, decoupling and dynamic polymorphism.|
|Variable declaration||We can declare variables||In interface we cannot do that.|
|Inheritance vs Implementation||Abstract classes are inherited.||Interfaces are implemented.|
Watch video on regular expression with practical demonstration as follows: -