This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 32633

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]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Display the data in List
jQuery in Action, 3rd edition