Hi I have that error:
incompatibles types: List<Car> cannot be converted to Iterable<Iterator>
incompatibles types: List<Truck> cannot be converted to Iterable<Iterator>
The class Car extends the class Vehicle. The Truck also extends Vehicle. I have to create the Vehicle class iterable??
public static void print(Iterable<Vehicle> it){
for(Vehicle v: it) System.out.println(v);
}
public static void main(String[] args) {
List<Car> lcotxe = new LinkedList<Car>();
List<Truck> lcamio = new LinkedList<Truck>();
print(lcotxe);//ERROR
print(lcamio);//ERROR
}