You cannot Invoke Explicit Interface with Class Instance,You require Interface Instance to call the Explicit Interface
class Sample:ITest { //Interface Defined Explicitly void ITest.Test() { Console.WriteLine("Hello"); } }
To Invoke the explicit interface,you need Interface Instance,not the class instance
/*You cannot invoke Explicit Interface with Class Instance but the Interface instance. ITest is the inetrface instance */ ITest s1 = new Sample(); s1.Test();
Reblogged this on Dinesh Ram Kali..
LikeLike