title: Polymorphism/Overriding
body: <p>Could someone please explain what the difference is between these two examples?</p>
  
  <blockquote>
    <h1>Class A</h1>
    
    <p><code>protected virtual string GetData()</code></p>
    
    <h1>Class B</h1>
    
    <p><code>private override string GetData()</code></p>
  </blockquote>
  
  <p>And the following:</p>
  
  <blockquote>
    <h1>Class A</h1>
    
    <p><code>protected string GetData()</code></p>
    
    <h1>Class B</h1>
    
    <p><code>private string GetData()</code></p>
  </blockquote>
  
  <p>Assuming that 'Class B' inherits from 'Class A'.</p>
  
  <p>I always assumed that you need to use <code>virtual</code> in the superclass and <code>override</code> in the subclass if you want overriding of a method, however I tried removing the keywords and the program compiled fine. What exactly is the difference, if any?</p>