コード例 #1
0
        static void Main(string[] args)
        {
            MyTest myTest1 = new MyTest();

            myTest1.MyTestMethod(1);

            IMyTest myTest2 = myTest1;

            myTest2.MyTestMethod(2);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }