網路城邦
上一篇 回創作列表 下一篇   字體:
取得 map中各 object的值
2011/10/07 17:23:08瀏覽286|回應0|推薦1
*********************************************************************************
    public static String getValue(Map map, String key)
    {
        StringBuffer sb = new StringBuffer();
        Object val = map.get(key);
        if(val instanceof Collection)
        {
            Collection col = (Collection)map.get(key);
            if(col != null)
            {
                for(Iterator it = col.iterator(); it.hasNext(); sb.append((String)it.next()));
            }
        }
        return sb.toString();
    }
********************************************************************************


在map中放入新的object
                map.put("tel", "1234567890");
( 休閒生活網路生活 )
回應 推薦文章 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=ulinaboy&aid=5713864