aspose file tools
The moose likes Beginning Java and the fly likes Iterator, Comparator Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Iterator, Comparator" Watch "Iterator, Comparator" New topic
Author

Iterator, Comparator

Sachin Ramesh Vir
Greenhorn

Joined: Sep 15, 2005
Posts: 23
Hi,

What is Iterator, Comparator and Enumerator? I am always confused these two things. I really appreciate if someone provide me the coding that explains iterator and comparator and enumerator
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Iterators and enumerators have the same job function; to walk through a collection of data objects one element at a time. That's it.

The reason they are described so generally in some documentation is that the interfaces hide the details of how they work. This is intended to keep the use of such objects clear without requring an understanding of the implementation. Unfortunately, it also makes things a bit harder to work out, if you're learning.

Read a tutorial on the Collections API for a full treatment.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
In case you need some links, you can find some useful information on the following web pages:

The Java Tutorial (including The Collections Trail)
The Java API documentation

These are both very useful links, so you should bookmark them. I especially encourage you to learn how to navigate the API docs. If you know what documentation is already available and how to use it, you will be able to find the answers to similar questions on your own in the future.

Layne
[ September 20, 2005: Message edited by: Layne Lund ]

Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Iterator, Comparator
 
Similar Threads
Iterator can safely remove?
Iterator vs. Enumeration for getInitParameterNames
How do I convert Iterator to Enumerator?
how is an iterator created?
Iterator Vs Enumerator