static void Main(string[] args) { MyTest myTest1 = new MyTest(); myTest1.MyTestMethod(1); IMyTest myTest2 = myTest1; myTest2.MyTestMethod(2); }
static void Main(string[] args) { MyTest myTest1 = new MyTest(); // The following line won't compile as MyTest method is not available // without first casting to IMyTest //myTest1.MyTestMethod(1); IMyTest myTest2 = new MyTest(); myTest2.MyTestMethod(2); }
static void Main(string[] args) { IMyTest myTest1 = new MyTest(); myTest1.MyTestMethod(1); MyTest myTest2 = new MyTest(); // The following line won't compile as it does not pass a required // parameter. //myTest2.MyTestMethod(2); }