aspose file tools
The moose likes Beginning Java and the fly likes Iterator and user defined collections Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Iterator and user defined collections" Watch "Iterator and user defined collections" New topic
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
    
  13

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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Iterator and user defined collections
 
Similar Threads
Collection and Map
enumeratio or iterator
[hibernate] How to load lazy collections
problems about Collections
Enumerations Vs Iterators