java.util.Hashtable.toString() 方法


java.util.Hashtable.toString() 方法

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("String form of hash table is: "+htable.toString());
   }    
}