What will be the result of code execution?

using System;

namespace Quizful
{
    public class A
    {
        public A()
        {
            Evt += x => Console.WriteLine(x);
        }

        public event Action<object> Evt;

        public void DoAction()
        {
            if (Evt != null)
                Evt("Hello");
        }

        public void Print(object o)
        {
            Console.WriteLine(o);
        }
    }

    public class B : A
    {
        public B()
        {
            Evt += x => Console.WriteLine(x);
        }
    }

    public class Program
    {
        static void Main(string[] args)
        {
            A a = new B();
            a.Evt += a.Print;
            a.DoAction();
            Console.ReadKey();
        }
    }
}

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты