title: Java: Creating a subclass object from a parent object
body: <p>Newbie Java question. Say I have:</p>
  
  <pre><code>public class Car{
    ...
  }
  
  public class Truck extends Car{
    ...
  }
  </code></pre>
  
  <p>Suppose I already have a Car object, how do I create a new Truck object from this Car object, so that all the values of the Car object is copied into my new Truck object?
  Ideally I could do something like this:</p>
  
  <pre><code>Car c = new Car();
  /* ... c gets populated */
  
  Truck t = new Truck(c);
  /* would like t to have all of c's values */
  </code></pre>
  
  <p>Would I have to write my own copy constructor? This would have to be updated everytime Car gets a new field...</p>