ArrayList<String> list = new ArrayList<String>();     
JSONArray jsonArray = (JSONArray)jsonObject; 
if (jsonArray != null) { 
   int len = jsonArray.length();
   for (int i=0;i<len;i++){ 
    list.add(jsonArray.get(i).toString());
   } 
} 
Answer from Pentium10 on Stack Overflow
๐ŸŒ
HowToDoInJava
howtodoinjava.com โ€บ home โ€บ gson โ€บ gson โ€“ parse json array to java array or list
Gson - Parse JSON Array to Java Array or List
April 4, 2023 - Learn to use Google GSON library to deserialize or convert JSON, containing JSON array as root or member, to Java Array or List of objects.
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ converting-json-array-to-a-java-array-or-list
Convert JSON Array to a Java Array or List with Jackson
September 8, 2020 - In this article, we've used Jackson to parse and map the values from a JSON String and file into a Java array and list.
๐ŸŒ
Blogger
javarevisited.blogspot.com โ€บ 2013 โ€บ 04 โ€บ convert-json-array-to-string-array-list-java-from.html
How to Convert JSON array to String array in Java - GSon example
This Java example uses the GSON library to create a List of String from JSON array and further Java standard library to convert List to an array. Instead of declaring JSON array in Code, which we did here for demonstration purposes, you can also read input from a file, database, or any URL.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ how-to-convert-json-array-object-to-java-object
How to Convert JSON Array Object to Java Object? - GeeksforGeeks
July 23, 2025 - In the above code, we have a JSON string jsonString representing an array of user objects. We have created an ObjectMapper instance from the Jackson library, which helps with JSON processing. We have used the readValue() method of the ObjectMapper to convert the JSON string into an array of User objects.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ How-to-convert-JSON-Array-to-normal-Java-Array
How to convert JSON Array to normal Java Array?
February 19, 2020 - import java.util.Arrays; import org.json.JSONArray; public class JsonToArray { public static void main(String args[]) throws Exception { String [] myArray = {"JavaFX", "HBase", "JOGL", "WebGL"}; JSONArray jsArray = new JSONArray(); for (int i = 0; i < myArray.length; i++) { jsArray.put(myArray[i]); ...
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ how-to-convert-json-array-to-string-array-in-java
How to Convert JSON Array to String Array in Java? - GeeksforGeeks
July 23, 2025 - JavaScript. They can be understood as a collection of data (strings, numbers, booleans) in an indexed manner. Given a JSON array, we will discuss how to convert it into a String array in Java.
Top answer
1 of 3
58

for your example:

{'profiles': [{'name':'john', 'age': 44}, {'name':'Alex','age':11}]}

you will have to do something of this effect:

JSONObject myjson = new JSONObject(the_json);
JSONArray the_json_array = myjson.getJSONArray("profiles");

this returns the array object.

Then iterating will be as follows:

    int size = the_json_array.length();
    ArrayList<JSONObject> arrays = new ArrayList<JSONObject>();
    for (int i = 0; i < size; i++) {
        JSONObject another_json_object = the_json_array.getJSONObject(i);
            //Blah blah blah...
            arrays.add(another_json_object);
    }

//Finally
JSONObject[] jsons = new JSONObject[arrays.size()];
arrays.toArray(jsons);

//The end...

You will have to determine if the data is an array (simply checking that charAt(0) starts with [ character).

Hope this helps.

2 of 3
1

You can prefer quick-json parser to meet your requirement...

quick-json parser is very straight forward, flexible, very fast and customizable. Try this out

[quick-json parser] (https://code.google.com/p/quick-json/) - quick-json features -

  • Compliant with JSON specification (RFC4627)

  • High-Performance JSON parser

  • Supports Flexible/Configurable parsing approach

  • Configurable validation of key/value pairs of any JSON Heirarchy

  • Easy to use # Very Less foot print

  • Raises developer friendly and easy to trace exceptions

  • Pluggable Custom Validation support - Keys/Values can be validated by configuring custom validators as and when encountered

  • Validating and Non-Validating parser support

  • Support for two types of configuration (JSON/XML) for using quick-json validating parser

  • Require JDK 1.5 # No dependency on external libraries

  • Support for Json Generation through object serialization

  • Support for collection type selection during parsing process

For e.g.

JsonParserFactory factory=JsonParserFactory.getInstance();
JSONParser parser=factory.newJsonParser();
Map jsonMap=parser.parseJson(jsonString);
๐ŸŒ
CodeSpeedy
codespeedy.com โ€บ home โ€บ how to convert json array to normal java array easily
Convert JSON array to normal Java Array easily - CodeSpeedy
October 14, 2018 - Learn how to convert JSON array to normal Java Array easily. You can use both array and arraylist here. Learn with proper example.
๐ŸŒ
Mkyong
mkyong.com โ€บ home โ€บ java โ€บ how to parse json array with jackson
How to parse JSON Array with Jackson - Mkyong.com
April 23, 2024 - In Jackson, we can convert the JSON array to an Array or List. ... package com.mkyong.json.jackson; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.mkyong.json.model.Person; import java.util.List; public class JsonArrayToObjectExample { public static void main(String[] args) throws JsonProcessingException { String jsonArray = "[{\"name\":\"mkyong\", \"age\":42}, {\"name\":\"ah pig\", \"age\":20}]"; ObjectMapper mapper = new ObjectMapper(); // 1.
๐ŸŒ
Cloudera Community
community.cloudera.com โ€บ t5 โ€บ Support-Questions โ€บ Converting-JSON-to-Java-Object-Array โ€บ td-p โ€บ 153155
Solved: Converting JSON to Java Object Array - Cloudera Community - 153155
February 1, 2017 - Error: Can not deserialize instance of java.lang.Object[] out of START_OBJECT token at [Source: {"f1":1,"f2":"abc"}; line: 1, column: 1] ... import org.json.JSONObject; public class JSONParser { public static void main(String[] args) { String jsonStr = "{\"field1\":1,\"field2\":\"abc\"}"; JSONObject json = new JSONObject(jsonStr); Person person = new Person(); person.setKey(json.getInt("field1")); person.setValue(json.getString("field2")); System.out.println(person.toString()); } }
๐ŸŒ
Java Code Geeks
javacodegeeks.com โ€บ home โ€บ core java
Converting a JSON Object to a JSON Array in Java - Java Code Geeks
August 1, 2025 - To convert this object into a JSON array, the code first transforms the JSONObject into a Map using toMap(), then extracts only the values from that map using values(), and wraps those values in a new JSONArray.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-can-we-convert-a-jsonarray-to-string-array-in-java
How can we convert a JSONArray to String Array in Java?
June 6, 2025 - We can convert a JSONArray to String Array by using a simple loop as shown in the example below - import org.json.*; import java.util.*; public class JsonArraytoStringArrayTest { public static void main(String[] args) { JSONArray jsonArray = new JSONArray(); jsonArray.put("INDIA "); jsonArray.put("AUSTRALIA "); jsonArray.put("SOUTH AFRICA "); jsonArray.put("ENGLAND "); jsonArray.put("NEWZEALAND "); List < String > list = new ArrayList < String > (); for (int i = 0; i < jsonArray.length(); i++) { list.add(jsonArray.getString(i)); } System.out.print("JSONArray: " + jsonArray); System.out.print("\n"); String[] stringArray = list.toArray(new String[list.size()]); System.out.print("String Array: "); for (String str: stringArray) { System.out.print(str); } } }
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ how-to-convert-a-json-array-to-array-using-json-lib-api-in-java
How to convert a JSON array to array using JSON-lib API in Java?\\n
We can convert a JSON array to array by using the toArray() method of JSONArray class. This method produces an Object[] with the contents of JSONArray. ... import java.util.Arrays; import net.sf.json.JSONArray; public class ConvertJSONArrayToArrayTest { public static void main(String[] args) ...
๐ŸŒ
Medium
medium.com โ€บ @salvipriya97 โ€บ how-to-convert-json-array-to-java-pojo-using-jackson-367ac93f7b15
How to convert JSON array to Java POJO using Jackson | by Priya Salvi | Medium
June 18, 2024 - Main Class to Convert JSON to List of Person Objects: import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import java.util.List; public class Main { public static void main(String[] args) { String jsonArray = "[{\"name\":\"John\", \"age\":30, \"address\":[{\"apartment\":\"A1\",\"street\":\"Main St\",\"pinCode\":\"12345\"}], \"unknownField\":\"value\"}, {\"name\":\"Alice\", \"age\":25, \"address\":[{\"apartment\":\"B2\",\"street\":\"Second St\",\"pinCode\":\"67890\"}]}]"; try { ObjectMapper objectMapper = new ObjectMapper(); List<Person> per
๐ŸŒ
javathinking
javathinking.com โ€บ blog โ€บ java-convert-jsonnode-to-array
Java: Convert JsonNode to Array โ€” javathinking.com
Arrays in Java have a fixed size, ... JsonNode to an array involves iterating over the elements of the JsonNode (if it represents a JSON array) and extracting the values to populate a Java array....
๐ŸŒ
Stleary
stleary.github.io โ€บ JSON-java โ€บ org โ€บ json โ€บ JSONArray.html
JSONArray
If the value is not a string and is not null, then it is converted to a string. ... A String value. public String optString(int index, String defaultValue) Get the optional string associated with an index. The defaultValue is returned if the key is not found. ... A String value. ... Append a boolean value. This increases the array's length by one. ... Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.