Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

java 8 add whole array to jsonarray

import java.util.ArrayList;
import org.json.JSONArray;
public class ArrayToJson {
   public static void main(String args[]) {
      ArrayList <String> arrayList = new ArrayList<String>();
      arrayList.add("JavaFX");
      arrayList.add("HBase");
      arrayList.add("JOGL");
      arrayList.add("WebGL");
      JSONArray jsArray2 = new JSONArray(arrayList);
      System.out.println(jsArray2);
   }
}
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #java #add #array #jsonarray
ADD COMMENT
Topic
Name
3+6 =