67,513
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
String json = "{stu : {stuName : \"yinkaihua\", stuNo : \"0120510340202\"}}";
JSONObject jsObj = JSONObject.fromObject(json);
Student stu = (Student)JSONObject.toBean(jsObj.getJSONObject("stu"), Student.class);
System.out.println(stu.getStuName() + " " + stu.getStuNo());
}