Java.util.Dictionary.get() 方法


Java.util.Dictionary.get() 方法

package com.codingdict;

import java.util.*;

public class DictionaryDemo {
   public static void main(String[] args) {

      // create a new hashtable
      Dictionary dict = new Hashtable();

      // add elements in the hashtable
      dict.put("1", "Chocolate");
      dict.put("2", "Cocoa");
      dict.put("6", "Coffee");

      // returns the elements associated with the key
      System.out.println(dict.get("6"));
   }
}