Difference Between Abstract Class and Interface

Medium2-4 Years

Abstract classes provide partial implementation.

Interfaces define contracts.

Example

abstract class Animal
{
    public abstract void Speak();
}

interface IFly
{
    void Fly();
}

Interview Tips

A class can implement multiple interfaces but inherit only one class.