• Post Reply Bookmark Topic Watch Topic
  • New Topic

Iterator and user defined collections  RSS feed

 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you can show us the code you're using "with the Iterator" -- maybe we can tell you where you're going wrong.
 
Komal Amaresh
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry,

i was running an infinite loop.
had put a semicolon after(while(itr.hasNext());).....big blunder.

regards,
komal
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!