6.5. Summary

As with Java interfaces, a C# class can implement multiple interfaces, and C# interfaces can extend each other. However, there are some differences in how the two languages treat the implementation of interfaces. Here are the key points to remember from this chapter:

  • C# does not care which access modifiers are on an interface, even if the interface and the implementing class are in different namespaces. In Java, the interface must be public if it is to be implemented by a class in a different package.

  • A C# class implementing an interface method can have the method declared as public or explicitly declared using C# explicit interface declaration.

  • Through C#'s explicit interface declaration, a class can implement interfaces having common ...

Get .NET for Java Developers: Migrating to C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.