Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/01/2008, 16:28
tunombre
 
Fecha de Ingreso: enero-2008
Mensajes: 10
Antigüedad: 16 años, 4 meses
Puntos: 1
Re: Problema eliminando elemento de un ArrayList

He cambiado el bucle por si podía ser problema del Iterator pero sigue lanzandome el mismo error:

Código:
  public void sacaCoche(String matricula)
	{
		Coche cocheABorrar = null;

		for( int i=0; i<this.listadoCoches.size(); i++)
		{
			Coche coche = this.listadoCoches.get(i);
			if(coche.getMatricula().equalsIgnoreCase(matricula))
			{
				cocheABorrar = coche;
				break;
			}
		}
		if( cocheABorrar == null )
			System.out.println("Coche no encontrado");
		else this.listadoCoches.remove(cocheABorrar);		
	}
Nadie ve dónde puede estar el error?