title: Executing a method on subclass in downcasting
body: <p>How can I execute a method to generate data for subclass fields while down-casting the object?</p>
  
  <p>For example:</p>
  
  <pre><code>public class Animal
  {
    public string name;
  }
  
  public class Dog extends Animal
  {
    public string lastName;
  
  //I want this method to be called when down casting...
    public void generateLastName()
    {
      this.lastName="Something";
    }
  }
  </code></pre>