what is Enumeration in java?

An enumeration is an object that generates elements one at a time, used for passing through a collection, usually of unknown size. The traversing of elements can only be done once per creation.
An enumeration is an object that generates elements one at a time, used for passing through a collection, usually of unknown size.
The traversing of elements can only be done once per creation.

Enumeration’s have two options:
  • nextElement() which returns the next object in the collection
  • hasMoreElements() which returns true, until the last object has been returned by nextElement()


Enter your email address to get our daily JOBS & INTERVIEW FAQ's Straight to your Inbox.

Make sure to activate your subscription by clicking on the activation link sent to your email