Query regarding Enumeration
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chandu_veligeti
Posted On:   Wednesday, December 1, 2004 08:10 PM

In Enumeration we are having the nextElement() abstract method. where can i get the implementation of that method. I mean where can i get the code for that method.

Re: Query regarding Enumeration

Posted By:   Anonymous  
Posted On:   Friday, December 3, 2004 06:34 AM

That depends on the underlying data structure. It is a different thing between going over a list or a tree. Next point is that you should use the java.util.Iterator instead and the Collection API (since Java 1.2). Simply does the same but it´s the de facto standard. I dont know whether Enumeration is marked as deprecated... Enumeration.hasMoreElements()=Iterator.hasNext() and Enumerations.nextElement()=Iterator.next(). For Iterator you´ll find some implementation in java.util.AbstractList (a parent of Vector).
About | Sitemap | Contact