Hai im having doubt in this line
int i = ((Integer)it.next()).intValue();
1)why casting is done here and why we have used intValue().
2) Im having doubt in hasNext() execution..here there are two elements.
in the first hasNext() test the value is true and it enters into the loop and it points to the next element.
when again the hasNext() is checked it should return false as there no element after 6.then how it is executed??
please explain in detail the execution of hasNext() in detail thanks in advance