更新时间:2023-02-14 11:45:07
您可以使用 GSON 库来实现这一点.
You can use the GSON library to accomplish this.
ArrayList<String> mylist = new ArrayList<String> ();
mylist.add("abc");
mylist.add("cfd");
mylist.add("ert");
mylist.add("fg");
mylist.add("ujk");
String json = new Gson().toJson(mylist);
您可以参考 GSON 用户指南以获得更多支持.
You can refer to the GSON User Guide for more support.