How a java iterator works internally?
<p>/* I have a list of employees */</p>

<pre><code>List&lt;Employee&gt; empList=new ArrayList&lt;Employee&gt;();
empList.add(employee1);
empList.add(employee2);
empList.add(employee3);
empList.add(employee4);
</code></pre>

<p>/* I have taken an iterator */</p>

<pre><code>Iterator&lt;Employee&gt; empIterator=empList.iterator();
</code></pre>

<p>In the above line , I was trying to get an iterator over the list. My doubt is what would be there in the iterator (will all the list objects be copied into it or the list object is cloned or... I'm just clueless). Help me in understanding this.
Thanks in advance.</p>