import java.util.ArrayList; import java.util.Iterator;
publicclassVehicleData{privateArrayListvehicles;publicVehicleData(){vehicles=newArray...
public class VehicleData{
private ArrayList vehicles;
public VehicleData(){
vehicles=new ArrayList();
}
public void addVehicle(Vehicle aVehicle){
vehicles.add(aVehicle);
}
public void list(){
for(Iterator iter=vehicle.iterator();iter.hasNext();){
Vehicle vehicle=(Vehicle)iter.next();
vehicle.printInfo();
System.out.println();
}
}
} 调试 运行后 提示需要class interface或enum 怎么解决这个问题?请高手指点一下,十分感谢! 展开
private ArrayList vehicles;
public VehicleData(){
vehicles=new ArrayList();
}
public void addVehicle(Vehicle aVehicle){
vehicles.add(aVehicle);
}
public void list(){
for(Iterator iter=vehicle.iterator();iter.hasNext();){
Vehicle vehicle=(Vehicle)iter.next();
vehicle.printInfo();
System.out.println();
}
}
} 调试 运行后 提示需要class interface或enum 怎么解决这个问题?请高手指点一下,十分感谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询