import org.json.simple.JSONObject;
public class Main
{
public static void main(String[] args) {
JSONObject jsonObj = new JSONObject();
String stringArray = "[1,2]";
jsonObj.put("stringified_array", stringArray);
//When I tried to print, output of jsonObject is
{
"stringified_array" : [1,2] //Here, [1,2] type is JSONArray
}
//But I want the result to be
{
"stringified_array" : "[1,2]" //Here, "[1,2]" type is String
}
}
}