Querry on Hashtable in Collection Frameworks
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Biswa_Mishra
Posted On:   Tuesday, June 22, 2004 02:09 AM

How can i use Iterator in place of Enumeration in Hashtable?
While using Enumeration in Hashtable i used to call the Keys() method of Hashtable which returns Enumeration.How i will use Iterator in the place of Enumeration?

Re: Querry on Hashtable in Collection Frameworks

Posted By:   Aditya_Athalye  
Posted On:   Wednesday, July 21, 2004 03:51 AM

Use values() method of HashMap which returns a collection of all value objects in the HashMap and then iterate on this collection

Re: Querry on Hashtable in Collection Frameworks

Posted By:   vijay_raghavan  
Posted On:   Friday, June 25, 2004 04:02 AM

As explained above. Better master the usage of inbuilt Classes in JDK to avoid elementary doubts

Re: Querry on Hashtable in Collection Frameworks

Posted By:   vijay_raghavan  
Posted On:   Friday, June 25, 2004 04:02 AM

As explained above. Better master the usage of inbuilt Classes in JDK to avoid elementary doubts

Re: Querry on Hashtable in Collection Frameworks

Posted By:   Sean_Owen  
Posted On:   Tuesday, June 22, 2004 07:04 AM

"keySet()" is the equivalent method from the Collections framework. So you should use "Iterator i = hashtable.keySet().iterator();".
About | Sitemap | Contact