Iterator? What Iterator are you using here?
Maybe
you should call: inventory.iterator() ?
If you had a for loop, I would expect to see :
To convert a for loop to a while loop, you have to have all of the elements
- initialization of your loop counter (int i=0)
- a condition check to end the loop (i<inventSize), and
- code to increment each time through the loop (i++).
Which one of those three is missing from your code?
>