怎么样打印出,hashtable中的所有内容啊?感谢

解决方案 »

  1.   

    for(int i=0;i<hashtable.size();i++){
    Sysytem.out.println(hashtable.get(key));
    }
      

  2.   

    自己初始化
    HashMap map;
    Set set = map.keySet();
    Iterator it = set.iterator();
    while(it.hasNext()){
    map.get(it.next());
    }
      

  3.   

    Map map = new HashMap();
    map.set("a","b");
    Iterator it = map.keySet().iterator();
    while (it.hasNext()) {
    Object key =it.next();
    System.out.println("key is "+key);//
    System.out.println("value is "+map.get(key));}
      

  4.   

    jianghuxiaoxiami(江湖小虾米) 程序的第二行应该改成map.put("a","b");map没有set方法
    我看了API文档才知道的。本人也是新手,请指教