发布网友 发布时间:2022-04-20 21:59
共1个回答
热心网友 时间:2023-06-30 02:34
public static JSONObject toJSONObject(Object object)
{
return JSONObject.fromObject(object);
}
public static void main(String[] args) {
JSONObject object = toJSONObject("{\"Title\":\"光辉岁月\",\"Description\":\"\",\"MusicUrl\":\"http://qcll.chd.e.cn/dzja/ghsy.mp3\",\"HQMusicUrl\":\"http://qcll.chd.e.cn/dzja/ghsy.mp3\"}");
System.out.println(object.get("Title"));
System.out.println(object.get("Description"));
System.out.println(object.get("MusicUrl"));
System.out.println(object.get("HQMusicUrl"));
}
以上代码依赖于json-lib-2.3-jdk15.jar