在json中new String[]出现了乱码
private static void JSONObject() {
// TODO Auto-generated method stub
JSONObject wangxiaoer = new JSONObject();
wangxiaoer.put("name", "王小二");
wangxiaoer.put("age", 25.2);
wangxiaoer.put("birthday", "1990-01-01");
wangxiaoer.put("major" ,new String[]{"1","2"});
wangxiaoer.put("car",null);
wangxiaoer.put("house",null);
System.out.println(wangxiaoer.toString());
}
}
得出来的结果是这样的
{"car":null,"birthday":"1990-01-01","age":25.2,"name":"王小二","house":null,"major":[Ljava.lang.String;@b166b5}