title: C# Abstract Class : Cannot implicitly convert type type1 to type2
body: <p>I have an interface, 3 classes that implement the interface and one of these classes is supposedly abstract.</p>
  
  <pre><code>iAnimal // Interface
  Animal // Abstract Class (Implements iAnimal)
  Fox // Class (Implements iAnimal)
  Deer // Class (Implements iAnimal)
  
  Animal animal; // declare an animal
  Switch (type)
  {
       Case "Fox":
           animal = new Fox();
           break;
       Case "Deer":
           animal = new Deer();
           break;
  }
  
  animal.eat();
  </code></pre>
  
  <p>I only want to call the eat function on an animal which is the result of the switch statement.</p>
  
  <p>However I get the error:</p>
  
  <p>Cannot implicitly convert type type1 to type2.</p>
  
  <p>Is there anything wrong with the above logic?</p>
  
  <p>Thanks.</p>