1

I have a json file which is

 [
  {
   "time" : "72",
  "min" : "22"
 }
]

So, in order me to change into the java, I used

 JSONArray array = new JSONArray();
 JSONObject json = new JSONobject();
 json.put("time","72");
 json.put("min","22");
 array.put(json);

Now I am not sure how I can change into the string that array which has an json object? Like can I save it into the string variable in java?

1 Answer 1

1

Is this the code you're looking for?

String jsonString = json.toString();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.