继承关系:
public abstract class JSON implements JSONStreamAware, JSONAware {}
public class JSONObject extends JSON implements Map<String, Object>, Cloneable, Serializable, InvocationHandler {}
public class JSONArray extends JSON implements List<Object>, Cloneable, RandomAccess, Serializable {}
1.JSONObject 的常用方法
//数据准备
List<Student> list=new ArrayList<Student>();
list.add(new Student(1,1000d,"旅游",new Date()));
list.add(new Student(2,1500d,"玩电脑游戏",new Date()));
list.add(new Student(3,3000d,"看电影",new Date()));
Student student=new Student(1,1000d,"旅游",new Date());
JSONObject jsonObject=new JSONObject();
jsonObject.put("8", "签名");
jsonObject.put("d", 10.0);
jsonObject.put("date", new Date());
jsonObject.put("stu", new Student(8,8000d,"购物",new Date