请教

解决方案 »

  1.   

    value可以重复,key不可以重复,我认为你不可能用value取道key
      

  2.   

    请教楼上遍历判断相等后如果取KEY呢?
    如下方法是遍历过程
    public static synchronized boolean deleteUserByName(String loginname) {
          Iterator it = hmUserList.keySet().iterator();
          boolean bool = false;
          while (it.hasNext()) {
            Object obj = it.next();
            if(hmUserList.get(obj).toString().startsWith(loginname + OperateCode.USER_CHAR_1)){
              //hmUserList.remove(obj);????
              bool = true;
              break;
            }
          }
          return bool;
        }
      

  3.   

    楼主这个好像有违Map的初衷啊
      

  4.   

    如果你hmUserList.get(obj)的value与你的value相同,那obj不就是你要的key值吗
      

  5.   

    解决问题,谢楼上www_sql(工业区)提醒