An interface is a contract that defines what methods a class must have.
It does not contain full implementations (in basic usage), only method definitions. Classes that implement the interface must provide the actual logic.
Interfaces allow different classes to follow the same structure while having different implementations.
A class implements an interface using the : symbol.
The class must provide implementations for all interface methods.
You can use an interface as a reference type, which allows you to work with different classes in a consistent way.
The method that runs depends on the actual object type.
A class in C# can implement multiple interfaces.
This allows a class to have multiple behaviors, which is not possible with inheritance alone.
Interfaces and classes are both used in object-oriented programming, but they serve different purposes.
Interfaces are commonly used to define shared behavior across different types.
Interfaces are widely used in C# applications, especially in large systems and frameworks.
Create an interface IVehicle with a Start() method. Then create Car and Bike classes that implement it.