aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes enum, Enum, Enumeration, Enumerator, Iterator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "enum, Enum, Enumeration, Enumerator, Iterator" Watch "enum, Enum, Enumeration, Enumerator, Iterator" New topic
Author

enum, Enum, Enumeration, Enumerator, Iterator

Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 688

I think that I figured out what is what here.

enum is the new keyword in Java 5 that allows you to implement enumerated types.

Enum is a class in java.lang for which types defined using the enum keyword all all subclasses.

Enumerator is similiar to an Iterator only the Enumerator is an older class.

Iterator is a newer class than Enumeration that allows you to iterate over objects of classes that implement Iterable.

Then there is the new for-each loop in Java 5 that is an alternative to using an object of type Iterator to iteration over an array or an object that implements the Iterable interface.

Is this all right?

Kaydell
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Near enough.
Here's a summary of the new Java 5.0 features.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
Consider Paul's rocket mass heater.
 
subject: enum, Enum, Enumeration, Enumerator, Iterator
 
Similar Threads
Iterator & Enumeration
[Interview Q] Why does array index begin with 0 instead of 1 ???
Using Iterable
enhanced for loop question
Of Enumerators and Iterators