This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display the data in List

 
Chen ZhiJiang
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All:
I have one basis problem:
I have a LIST contact some data, i display it use:
Iterator a=ListData.Iterator();
while(a.hasNext())
{
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.
ZhiJIang
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic