# Interface

A list of methods a class promises to provide, with no code of its own.

## What is **Interface**?

An **interface** is a promise: a list of methods a class agrees to provide, with no code of its own. Any class that implements `IPayment` must have a `Pay` method, so the checkout can accept cards, PayPal or gift cards the same way.

```csharp
public interface IPayment
{
    void Pay(decimal amount);
}

public class CardPayment : IPayment
{
    public void Pay(decimal amount) => Console.WriteLine($"Charged {amount:C} to card");
}
```

Level: Journeyman · [More OOP terms at this level](https://www.ask-codey.com/glossary/subjects/oop/journeyman)

Updated: September 27, 2026

## In other subjects

- [Interface in C#](https://www.ask-codey.com/glossary/interface-c-sharp)
- [Interface in Java](https://www.ask-codey.com/glossary/interface)

Source: https://www.ask-codey.com/glossary/interface-oop
