Scenario :-
Lets now discuss explicit implementation of interface be taking below example. In explicit implementation functions are qualifies with parent interface names as below:-
public interface MyInterface
{
int foo();
}
public class MyClass : MyInterface
{
int a = 10;
#region myinterfacse Members
int MyInterface.foo()
{
throw new NotImplementedException();
}
#endregion
}
Now there will be some errors in code of scenario 10 as below
MyClass obj = new MyClass();
MyInterface obj2 = (MyInterface)obj;
obj.foo(); //Compile time error.No class member foo
obj2.foo(); //Returns 10