Create ArrayList from array java
new ArrayList<>(Arrays.asList(array))
Create ArrayList from array java
new ArrayList<>(Arrays.asList(array))
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);
}
}
add to json object javascript
object.property = value;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us