static void Main(string[] args) { MyClass mc = new MyClass(); IIfc1 ifc1 = (IIfc1)mc; // Get ref to IIfc1. IIfc2 ifc2 = mc as IIfc2; // Get ref to IIfc2. mc.PrintOut("object"); // Calling through object. ifc1.PrintOut("interface1"); // Calling through IIfc1. ifc2.PrintOut("interface2"); // Calling through IIfc2. }
static void Main(string[] args) { MyClass mc = new MyClass(); mc.Method1(); }