日期:2014-05-20 浏览次数:20745 次
Map map = new HashMap(); map.put("name", "json"); map.put("bool", Boolean.TRUE); map.put("int", new Integer(1)); map.put("arr", new String[] { "a", "b" }); JSONObject json = JSONObject.fromObject(map); System.out.println(json);
Map map = new HashMap(); map.put("name", "json"); map.put("arr", new String[] { "a", "b" }); map.put("int", new Integer(1)); map.put("bool", Boolean.TRUE); JSONObject json = JSONObject.fromObject(map); System.out.println(json);