finding a bug in a program
<p>There is suppose to be some sort of fault before location A in the code below but I can't seem to figure it out. Does have something to do with the clone method? I just need help figuring where the error is and why then I can go about fixing it myself. Thank you.</p>

<pre><code>class Vehicle implements Cloneable {

   private int x;

   public Vehicle(int y) { x = y;}

   public Object clone() { 
      Object result = new Vehicle(this.x);
      // Location "A"
      return result;
   }
   // other methods omitted
}

class Truck extends Vehicle {

   private int y;

   public Truck(int z) { super(z); y = z;}

   public Object clone() {
      Object result = super.clone();
      // Location "B"
      ((Truck) result).y = this.y;  // throws ClassCastException
      return result;             
   }
   // other methods omitted
}
</code></pre>