json与map装换的问题
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);