title: I wrote a program that allow two classes to "fight". For whatever reason C# always wins. What's wrong with VB.NET?
body: <p>I wrote a program that allow two classes to "fight". For whatever reason C# always wins. What's wrong with VB.NET ?</p>
  
  <pre><code>   static void Main(string[] args)
      {
          Player a = new A();
          Player b = new B();
  
          if (a.Power &gt; b.Power)
              Console.WriteLine("C# won");
          else if (a.Power &lt; b.Power)
              Console.WriteLine("VB won");
          else
              Console.WriteLine("Tie");
      }
  </code></pre>
  
  <p>Here are the players: 
  Player A in C#:</p>
  
  <pre><code>public class A : Player
  {
      private int desiredPower = 100;
  
      public override int GetPower
      {
          get { return desiredPower; }
      }
  }
  </code></pre>
  
  <p>Player B in VB.NET:</p>
  
  <pre><code>Public Class B
     Inherits Player
  
     Dim desiredPower As Integer = 100
  
     Public Overrides ReadOnly Property GetPower() As Integer
         Get
            Return desiredPower
         End Get
     End Property
   End Class
  </code></pre>
  
  <p>And here is a base class.</p>
  
  <pre><code>public abstract class Player
  {
      public int Power { get; private set; }
  
      public abstract int GetPower { get; }
  
      protected Player()
      {
          Power = GetPower;
      }
  }
  </code></pre>