title: Can't use virtual and override on the same method in C#
body: <p>So apparently you cannot use the <code>virtual</code> modifier with the <code>override</code> modifier.</p>
  
  <p><code>virtual</code> - a method that can be overridden</p>
  
  <p><code>override</code> - a method that is overriding a method of the same name in its parent's class</p>
  
  <p>This leads me to believe that if I override a method in a child class, if that child has a child you can't override that method again. </p>
  
  <p>And it is safe to say that if you put <code>override</code> and <code>virtual</code> in a method declaration you will get a compile error in C#. </p>
  
  <p>However I can't understand why the code I made below works the way in which it does</p>
  
  <pre><code>using System;
  public class DrawingObject
  {
  public virtual void Draw()
  {
      Console.WriteLine("Drawing Object");
  }
  }
  public class DrawDemo
  {
       public static int Main()
       {
            DrawingObject[] dObj = new DrawingObject[3];
  
  
            dObj[0] = new DrawingObject();
             dObj[1] = new Line();
             dObj[2] = new LittleLine();
  
             foreach (DrawingObject drawObj in dObj)
             {
                  drawObj.Draw();
             }
              Console.Read();
             return 0;
         }
    }
   public class Line : DrawingObject
   {
         public override void Draw()
         {// the method above me is in fact virtual because LittleLine overid it?
                 Console.WriteLine("I'm a Line.");
         }
    }
    public class LittleLine : Line
    {
         public override void Draw()
         {
                Console.WriteLine("I'm a Little Line.");
           }
      }
  </code></pre>
  
  <p>Here's the output:</p>
  
  <blockquote>
    <p>Drawing Object</p>
    
    <p>I'm a Line.</p>
    
    <p>I'm a Little Line.</p>
  </blockquote>
  
  <p>So the draw method in <code>Line</code> looks as though it was overridden by <code>LittleLine</code>. Is this code not actually overriding it, or is the compiler doing some other trick? Or am I not understanding the context of <code>virtual</code> and <code>override</code>?</p>