List list = new ArrayList();list.add("测试1");list.add("测试2");list.add("测试3");JSONArray jsonArray = JSONArray.fromObject(list);System.out.println(jsonArray.toString());这边要导包需要用到json-lib.jar, net.sf.json.JSONArray