| Author |
Iterator and user defined collections
|
Komal Amaresh
Ranch Hand
Joined: Oct 06, 2008
Posts: 67
|
|
Sir,
Can't the iterator be used with user defined collections.
In my code the for each loop is showing the result but the with the iterator, neither the program terminates nor does it give any output
Thanks in advance,
regards,
Komal
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24041
|
|
|
Perhaps you can show us the code you're using "with the Iterator" -- maybe we can tell you where you're going wrong.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Komal Amaresh
Ranch Hand
Joined: Oct 06, 2008
Posts: 67
|
|
Sorry,
i was running an infinite loop.
had put a semicolon after(while(itr.hasNext());).....big blunder.
regards,
komal
|
 |
 |
|
|
subject: Iterator and user defined collections
|
|
|