Interface

noun

say it: “IN-ter-fays” /ˈɪntərfeɪs/

A C# type, usually named with an I, that lists members a class promises to provide.

What is Interface in C#?

Interface — A contract describing behavior that implementing classes agree to provide.

interface IPrintable
{
    string Format()
    {
        return "Ready";
    }
}

class Ticket : IPrintable
{
}

In a sentence

  • “IShippable is an interface, and Book and Lamp both implement it.”

Level: Journeyman · More C# terms at this level

Updated

In other subjects