Possible Duplicate:
LinkedList iterator remove
private LinkedList flights;
...
public FlightQueue() {
    super();
    flights = new LinkedList();
}
...
public void clear(){
   ListIterator itr = flights.listIterator();
   while(itr.hasNext()){
        itr.remove();
   }
}
....
Exception in thread "main" java.lang.IllegalStateException
    at java.util.LinkedList$ListItr.remove(Unknown Source)
    at section1.FlightQueue.clear(FlightQueue.java:44)
    at section1.FlightTest001.main(FlightTest001.java:22)
No idea whats wrong, its showing the error at the first itr.remove().
 
     
     
     
     
    