先列举到Enumeratin 在一个个取出
然后put到hashtable2中去.

解决方案 »

  1.   

    不知道你的拷贝要求是怎样,如果不用clone,那么对象只是做了引用,实际上并没有拷贝,他们还是指向同一个对象。
      

  2.   

    Enumeration e = hashtable1.keys();
    //System.out.println("sssss:"+currentStep);
    while(e.hasMoreElements()){
    Integer tmp_k = (Integer)e.nextElement();
    hashtable2.put(tmp_k,(Integer)p.get(tmp_k));
    }
      

  3.   

    如果我要复制一个String对象可以用
    String str2 = new String(str1); 
    Hashtable的话是不是只能用枚举遍历然后插入来得到它的一个副本?
      

  4.   

    why do you need to copy anyway?