Пример #1
0
	static int Main ()
	{
		Derived d = new Derived ();

		//
		// This should call Derived.A and output a warning.
		//
		d.A ();

		
		if (d.which == 1)
			return 1;

		Console.WriteLine ("Test passes");
		
		return 0;
	}
Пример #2
0
    static int Main()
    {
        Derived d = new Derived();

        //
        // This should call Derived.A and output a warning.
        //
        d.A();


        if (d.which == 1)
        {
            return(1);
        }

        Console.WriteLine("Test passes");

        return(0);
    }
Пример #3
0
        static void Main()
        {
            A
                a = new A();

            Console.WriteLine(a.IsEven(4));
            //Console.WriteLine(a.IsOdd(3)); // Cannot access explicit implementation of 'IEven.IsOdd'

            Console.WriteLine(((IEven)a).IsOdd(3));

            var derived = new Derived();

            derived.A();
            derived.B();

            var iderived = derived as II;

            iderived.B();
        }