Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html" rel="noreferrer"><code>Properties</code></a> is a very specialized class that's designed to hold configuration and/or resources that are usually stored in some file.</p> <p>It has several features that <code>Hashtable</code> doesn't have (and shouldn't have):</p> <ul> <li>It supports reading and writing its content to a well-defined plain-text format (using <a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html#load(java.io.InputStream)" rel="noreferrer"><code>load()</code></a>/<a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html#store(java.io.OutputStream,%20java.lang.String)" rel="noreferrer"><code>store()</code></a>)</li> <li>It supports reading and writing its content to a well-defined XML-based format (using <a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html#loadFromXML(java.io.InputStream)" rel="noreferrer"><code>loadFromXML()</code></a>/<a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html#storeToXML(java.io.OutputStream,%20java.lang.String)" rel="noreferrer"><code>storeToXML()</code></a>)</li> <li>It supports a default mechanism <a href="http://java.sun.com/javase/6/docs/api/java/util/Properties.html#Properties(java.util.Properties)" rel="noreferrer">by providing another <code>Properties</code> instance at construction time</a>.</li> <li>It only supports <code>String</code> keys and values. While it is technically a <code>Map&lt;Object,Object&gt;</code> actually storing non-<code>String</code> keys or values is strongly discouraged and unsupported.</li> </ul> <p>A <a href="http://java.sun.com/javase/6/docs/api/java/util/Hashtable.html" rel="noreferrer"><code>Hashtable</code></a> on the other hand is a general-purpose <a href="http://java.sun.com/javase/6/docs/api/java/util/Map.html" rel="noreferrer"><code>Map</code></a> implementation (which is mostly replaced by the <a href="http://java.sun.com/javase/6/docs/api/java/util/HashMap.html" rel="noreferrer"><code>HashMap</code></a>, however).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload