static void Main()
        {
            DerivedType derived = new DerivedType();

             // Calls DerivedType.MethodOne.
             derived.MethodOne("string1", "string2");

             // Calls BaseType.MethodOne.
             derived.MethodOne("string1", (object)"string2");

             // Both of these call DerivedType.MethodTwo.
             derived.MethodTwo("string1", "string2");
             derived.MethodTwo("string1", (object)"string2");
        }
コード例 #2
0
        static void Main()
        {
            DerivedType derived = new DerivedType();

            // Calls DerivedType.MethodOne.
            derived.MethodOne("string1", "string2");

            // Calls BaseType.MethodOne.
            derived.MethodOne("string1", (object)"string2");

            // Both of these call DerivedType.MethodTwo.
            derived.MethodTwo("string1", "string2");
            derived.MethodTwo("string1", (object)"string2");
        }