首先导包 两个
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
转化
Gson g = new Gson();
Notice notice = g.fromJson(s, Notice.class); //json字符串转java对象 需要的是Gson
/*这里需要强转一下 默认是Object
JSONObject jsonStu = (JSONObject) JSONObject.toJSON(notice); //对象转JSONObject 需要的是上边的包