aspose file tools
The moose likes Beginning Java and the fly likes Display the data in List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Display the data in List" Watch "Display the data in List" New topic

Display the data in List

Chen ZhiJiang
Ranch Hand

Joined: May 18, 2002
Posts: 72
Dear All:
I have one basis problem:
I have a LIST contact some data, i display it use:
Iterator a=ListData.Iterator();
System.out.pritnln("Data: "+a.toString();
But how i can loop this iterator again. when i try to loop it again, the error shows i have reach the end of collection, how i can do loop again or using other methods.
Thanks in advanced.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32088

You would write the following statement again.

It's important to keep access to listData (the real data) because you need it to get a fresh iterator.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
It is sorta covered in the JavaRanch Style Guide.
subject: Display the data in List