日期:2014-05-16 浏览次数:20400 次
import net.sf.json.JSONObject;
public class JSONCombine
{
public static void main(String[] args)
{
JSONObject jsonOne = new JSONObject();
JSONObject jsonTwo = new JSONObject();
jsonOne.put("name", "kewen");
jsonOne.put("age", "24");
jsonTwo.put("hobbit", "Dota");
jsonTwo.put("hobbit2", "wow");
JSONObject jsonThree = new JSONObject();
jsonThree.putAll(jsonOne);
jsonThree.putAll(jsonTwo);
System.out.println(jsonThree.toString());
}
}