示例#1
0
        public static void Main(String[] args)
        {
            PrintHelloWorld();
            A a = new A(6);

            a.This.printN();
            var xx = new GenericAs <A>();

            xx.Add(1);
            xx.Add(2);

            var y = new InterfaceImplementor();

            (new PureMethods()).DoInterface(y);
            (new PureMethods()).DoInterface2(y);
            (new PureMethods()).DoClass(y);
            Console.WriteLine("Done");
        }
示例#2
0
 public void DoClass(InterfaceImplementor implementor)
 {
     Console.WriteLine(implementor.MethodA() + " Expected: MethodA()");
     Console.WriteLine(((MyInterface)implementor).MethodB() + " Expected: MyInterface.MethodB()");
     Console.WriteLine(implementor.PropertyA + " Expected: PropertyA");
 }