用到按名取值的应用时,就用到Hashtable.
如jndi中:
...
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial");
try {
    // Create the initial directory context
    DirContext ctx = new InitialDirContext(env);
...