Syntax

C# Implement an Interface Syntax

In C#, implement an interface: defines and implements an interface — interface IShape { double Area(); } class Circle : IShape { ... }

Quick Answer

Syntax
interface IShape { double Area(); } class Circle : IShape { ... }
C#Syntax

Implement an Interface

Code example
interface IShape { double Area(); } class Circle : IShape { ... }

Defines and implements an interface.

Learn More

How to implement an interface in C#

  1. Open your C# file or editor.
  2. Copy the example, then replace its sample names and values for your code.

C# Implement an Interface Syntax

Use interface IShape { double Area(); } class Circle : IShape { ... }.

Related Syntax References

Frequently asked questions

What is the C# syntax for implement an interface?

Use this pattern: interface IShape { double Area(); } class Circle : IShape { ... }

Can I copy this C# code example?

Yes. Use Copy code and adapt the example to your program.

Is this C# syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify