Just wanted to know. What are the differences between java.util.Properties Vs java.util.HashMap<String, String>? Which is preferable?
Just wanted to know. What are the differences between java.util.Properties Vs java.util.HashMap<String, String> ?
Share
They are similar, but from a design perspective, the
Propertiesclass is considered to be one of the “mistakes” of java, because it is aHashtable(rather than using a Hashtable). It should have been an interface.Always use the abstract where possible, so this is preferred:
Tend to avoid using
Propertiesunless you have to.