请教:java实体类转json对象,求Demo!!!!!!

有人知道java实体类转json对象吗?最好有Demo!!!!

http://blog.csdn.net/samliao_2012/article/details/7297704

http://blog.csdn.net/samliao_2012/article/details/7297704
http://www.cnblogs.com/linjiqin/archive/2011/03/03/1970270.html

Student stu = new Student();
stu.setGender("女");
stu.setStuAge(18);
stu.setStuName("xx");

    JSONObject jsonObj = JSONObject.fromObject(stu);
    System.out.println(jsonObj.toString());

JSONObject jsonObj = JSONObject.fromObject(entity);
System.out.println(jsonObj.toString());

Student stu = new Student();
stu.setGender("女");
stu.setStuAge(18);
stu.setStuName("xx");
JSONObject jsonObj = JSONObject.fromObject(stu);
System.out.println(jsonObj.toString());

JsonUtil.getJSONString(实体)