Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use ObjectSet?

843785Sep 15 2008 — edited Sep 16 2008
Hello!
i use ObjectSet object in my program;
private ObjectSet <Object> result;
...
while(result.hasNext()){
     System.out.println(result.next());
}
when you use result.next() i think there is a pointer to the next object in the set
but what if i need to start from the begining again? what should i do?
for example after this code:
firstobject = result.next();
...
nthobject = result.next();
i need to start from the beginig so that if i call result.next(); again the result will be firstobject again.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 14 2008
Added on Sep 15 2008
3 comments
275 views