java 8 add whole array to jsonarray

Solutions on MaxInterview for java 8 add whole array to jsonarray by the best coders in the world

showing results for - "java 8 add whole array to jsonarray"
Emilio
08 Feb 2016
1import java.util.ArrayList;
2import org.json.JSONArray;
3public class ArrayToJson {
4   public static void main(String args[]) {
5      ArrayList <String> arrayList = new ArrayList<String>();
6      arrayList.add("JavaFX");
7      arrayList.add("HBase");
8      arrayList.add("JOGL");
9      arrayList.add("WebGL");
10      JSONArray jsArray2 = new JSONArray(arrayList);
11      System.out.println(jsArray2);
12   }
13}