Diff between HashMap & Properties
4 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   MADHAV_PENUBALA
Posted On:   Tuesday, August 23, 2005 08:23 AM

Hi Friends,
Can any one tell me what exactly difference between Hashmap and Properties?

Re: Diff between HashMap & Properties

Posted By:   Anonymous  
Posted On:   Tuesday, September 13, 2005 01:16 AM

Diff between HashMap & Properties

Re: Diff between HashMap & Properties

Posted By:   Jani_Kaarela  
Posted On:   Wednesday, August 24, 2005 03:44 AM

A very important difference is, that Properties extends Hashtable, which is synchronized (unlike HashMap). Functionally, it's methods load(java.io.InputStream) and store(java.io.OutputStream, java.lang.String) are what sets it apart from ordinary Maps.


Personally, I suggest you only use it if you need the load/store functionality. Otherwise, use HashMap with or without synchronization (see Collections.synchronizedMap(java.util.Map)).


Oh, and by the way: this is definitely RTFM! stuff. Learn to use the API docs, it's a must if you want to consider yourself a Java programmer.

Re: Diff between HashMap & Properties

Posted By:   sadik_khan  
Posted On:   Wednesday, August 24, 2005 02:04 AM

I think this will help you understand the map interface

javaranch newsletter map interface

Re: Diff between HashMap & Properties

Posted By:   Christoph_Kutzinski  
Posted On:   Tuesday, August 23, 2005 08:54 AM

Read the API Specification and you will see the differences.
About | Sitemap | Contact