So I wrote this code but I got two errors message "int can not be dereferenced" and "boolean can not be dereferenced"
Can somebody help please?
* Set the status of the ambulance whose ID is given.
* @param id The ambulance's ID.
* @param area The ambulance's new area.
* @param free Whether it is now free or not.
private ArrayList<Ambulance> cars; public AmbulanceControl() { cars = new ArrayList<Ambulance>(); } public void setStatus(int id, int area, boolean free) { Iterator<Ambulance> ab = cars.iterator(); while(ab.hasNext()){ Ambulance ambulance = ab.next(); int carsID = ambulance.getID(); if(carsID == id ){ area.moveTo(); "int can not be dereferenced" free.setBusy(); "boolean can not be dereferenced" } } }