public class HashTableDemo { public static void main(String args[]) { // Create a hash map Hashtable balance = new Hashtable(); Enumeration names; String str; double bal; balance.put("Zara", new Double(3434.34)); balance.put("Mahnaz", new Double(123.22)); balance.put("Ayan", new...
Hashtable 對象包含用鍵/值對表示的項(xiàng)目。鍵被用作索引,通過搜索鍵,可以實(shí)現(xiàn)對值的快速搜索。通過Add() 方法向 Hashtable 添加項(xiàng)目。下面的代碼創(chuàng)建了一個(gè)名為 mycountries 的 Hashtable 對象,并添加了四個(gè)元素:<script runat="server"> Sub Page_Load if Not Page.IsPostBack then dim mycountries=New Hash...