| Introduction to OOP | Chapter 19: Container Classes : | next | previous | audio | real | text |
// create the iterator object
Enumeration e = aList.elements();
// then do the loop
while (e.hasMoreElements()) {
Object obj = e.nextElement();
// ... do something with obj
}
Interface consists of two methods, hasMoreElements and nextElement.