首页 > 代码库 > Map中存放数组

Map中存放数组

       Map<String,Object> map = new HashMap<String, Object>();
        Map<String,String> agentMap = new HashMap<String, String>();
        String agentAmt = "123";
        agentMap.put("agentAmt",agentAmt);
        agentMap.put("agentId", "35110230000000393");
        Map [] agentInfo = {agentMap};//[{agentAmt=210.00, agentId=35110230000000393}]
        String b = JsonUtil.toJson(agentInfo);

        map.put("agentInfo", b);//agentInfo=[Ljava.lang.String;@429f81f1

 

Map中存放数组