import org.json.JSONObject; public class JsonExample { public static void main(String[] args) { JSONObject jsonObject = new JSONObject(); jsonObject.put("name", "John"); jsonObject.put("age", 30); jsonObject.put("isStudent", false); String jsonString = jsonObject.toString(); System.out.println(jsonString); } } {"name":"John","age":30,"isStudent":false}


上一篇:
下一篇:
切换中文