I did an iterator
I have different objects
Some of them are cars, and other trucks (both of them are subclass of Vehicles )
When I iterate in every element of the vector
this error appears:
ClassCastException
this is my code
while it.hastnext()
if (it.next() instanceof truck
auxVehicle = (truck)it.next();
if (it.next() instanceof Car
auxVehicle = (Auto)it.next();