O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6.6. Implementing interfaces

Interfaces, though new to C++ developers, is already a well-used and well-understood concept in the Java world. The idea of interfaces in C# is the same as for Java, except for the minor differences described below.

To implement one or more interfaces, use the following syntax when declaring your class:

class <class_name>:<interface1>[,<interface2>,<interface3>...]

Like Java

  • C# does not support multiple class inheritance, but it does allow a class to implement multiple interfaces. [11]

    [11] We can say that both Java and C# support multiple interface inheritance, but only single implementation inheritance. Though it can be confusing to use the term 'inheriting an interface' instead of 'implementing an interface', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required