Java.util.Dictionary.put() 方法


Java.util.Dictionary.put() 方法

package com.codingdict;

import java.util.*;

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

      // create a new hasthtable
      Dictionary d = new Hashtable();

      // put some elements
      d.put("1", "Chocolate");
      d.put("2", "Cocoa");
      d.put("5", "Coffee");

      // print how many times put was called
      System.out.println("Number of times put was called:" + d.size());
   }
}