For example, you have two interfaces (I1 & I2) that both contain a Send method with the same signature (identical method name, same return type, same argument types in the same order:
public interface I1 { int Send(int id); } public interface I2 { int Send(int id); }
If you don't care which interface was used to make the call to the Send method, just implement the method:
public class c1 : I1, I2 { int Send(int id) { return 0; } }
If you do care about which interface was used to make the Send call, use Explicit Interface Implementation by specifying the interface name before the method name (I1.Send, I2,Send):
public class c1 : I1, I2 { int I1.Send(int id) { return 1; } int I2.Send(int id) { return 2; } }
In this case (when using Explicit Interface Implementation) the methods cannot be declared as public, although they are public (they can be called from code outside of the class). In other words, they're public with respect to the interface, but not with respect to the class.
Title | Date |
.NET Public-Key (Asymmetric) Cryptography Demo | July 20, 2025 |
Raspberry Pi 3B+ Photo Frame | June 17, 2025 |
EBTCalc (Android) Version 1.53 is now available | May 19, 2024 |
Vault 3 Security Enhancements | October 24, 2023 |
Vault 3 is now available for Apple OSX M2 Mac Computers! | September 18, 2023 |
Vault (for Desktop) Version 0.77 Released | March 26, 2023 |
EBTCalc (Android) Version 1.44 is now available | October 12, 2021 |