for(Enumeration enum = e.keys();enum.hasMoreElements();){
       Object keyObj;
       keyObj = (Object)enum.nextElement();
       Object valueObj;
       valueObj = e.get(keyObj);
       System.out.println(keyObj + "  = " +valueObj); 
     }

解决方案 »

  1.   

    Hastables are searched based on the key you input. Say you add a
    element to a hashtable ht as :-ht.putValue("My Message","Hello World!);My message is the key here. You can search for by doingString searchResult = (String) ht.getValue("My Message");your searchResult will have the string "Hello World".so the key in yours is 1 2 3 
    the searchResult will be the string " a b c "
      

  2.   

    up 是增加人氣值的意思和回復率
    up 後會到最前面!
      

  3.   

    试试下面的代码:
    --
            Hashtable ht = new Hashtable();
            ht.put("1", "a");
            ht.put("2", "b");
            ht.put("3", "c");        int len, i;
            len = ht.size();
            i   = 0;        String[] keys = new String[len];
            Enumeration e = ht.keys();        while (e.hasMoreElements()) {
                keys[i++] = (String)e.nextElement();
            }
            Arrays.sort(keys);        String[] values = new String[len];        for (i=0; i<len; i++) {
                values[i] = (String)ht.get(keys[i]);            System.out.println(keys[i] + "=" + values[i]);
            }
    --