Convert Java object to JSON object

h‮w//:sptt‬ww.lautturi.com
Convert Java object to JSON object
class Employee{
	public Employee(String string, int i) {
		name = string;
		age = i;
	}
	String name;
	int age;
}

Employee emp = new Employee("Alice",22);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(emp);
Created Time:2017-09-06 07:05:42  Author:lautturi