incompatible types - found java.util.Iterator(Lot) but expected java.util.Iterator (java.lang.String)
<p>I'm currently having a problem to iterate over a collection. When I declare the fields and constructor and try to enter my method to iterate over the collection and print out the elements, it comes up with the following error. </p>

<p>incompatible types - found java.util.Iterator(Lot) but expected java.util.Iterator (java.lang.String)</p>

<p>Here is my code.</p>

<pre><code>public class Auction
{
// The list of Lots in this auction.
private ArrayList&lt;Lot&gt; lots;
// The number that will be given to the next lot entered
// into this auction.
private int nextLotNumber;

/**
 * Create a new auction.
 */
public Auction()
{
    lots = new ArrayList&lt;Lot&gt;();
    nextLotNumber = 1;
}
public void close ()
{
    Iterator&lt;String&gt; it = lots.iterator();
    while(it.hasNext()) {
        System.out.println(it.next());
}
}
</code></pre>
