java.util.Hashtable.remove() 方法


java.util.Hashtable.remove() 方法

package com.codingdict;

import java.util.*;

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

      // create hash table
      Hashtable htable = new Hashtable(3);

      // populate the table
      htable.put(1, "TP");
      htable.put(2, "IS");
      htable.put(3, "THE");
      htable.put(4, "BEST");
      htable.put(5, "TUTORIAL");

      System.out.println("Initial hash table value: "+htable);

      // remove element at key 3
      htable.remove(3);

      System.out.println("Hash table value after remove: "+htable);
   }    
}