I am iterating through a collection of customer objects in an array list.
This code doesn't print the last object in the arraylist but it does print the first, and the rest. What could be the problem?Code:public void getCustomer() //TEST, DELETE AFTERWARDS { Iterator itCount = custDB.iterator(); Customer thisCustomer = (Customer)itCount.next(); //Loop tthrough all customers while(itCount.hasNext()) { thisCustomer.print(); System.out.println(); //Blank line for presentation //Move to next customer thisCustomer = (Customer)itCount.next(); } }




Reply With Quote