InterviewSolution
Saved Bookmarks
| 1. |
Differentiate between Iterator and Enumeration. |
||||||||||
|
Answer» Iterator: Because it can be applied to any Collection object, it is a UNIVERSAL iterator. We can EXECUTE both read and remove operations using Iterator. It's an ENHANCED version of Enumeration that adds the ability to remove an element from the list. Enumeration: An enumeration (or enum) is a data type that is defined by the user. It's mostly used to give integral constants names, which make a program EASIER to COMPREHEND and maintain. Enums are represented in Java (since 1.5) through the enum data type.
|
|||||||||||