Just like a little game of guessing went, I want to present you another C# riddle Cool :

using System;

namespace AnotherRiddle
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var w1 = new Wee { bar = new Foo() };
            if (w1.bar is Bar)
                Console.WriteLine("A");
            if (w1.bar.GetType() == typeof(Bar))
                Console.WriteLine("B");
        }
    }

    internal class Bar { }

    internal class Foo : Bar { }

    internal class Wee
    {
        public Bar bar;
    }
}

 

1. What do you think the code snippet will print at the console? 

2. What are all the differences between the two if constructs?