public void removeVehicle(String licenseNum){
for (Vehicle vehicle : vehicleLot){
String flag = vehicle.getLicenseNumber().toString();
if(flag.compareTo(licenseNum) == 0){
int num = vehicleLot.indexOf(vehicle);
vehicleLot.remove(num);
}
I am getting this exception, I am trying to remove a vehicle from a array list where it matched the license number like above.
my array list is like this private
List<Vehicle> vehicleLot = new ArrayList<Vehicle>();