jsonarray add jsonobject

Solutions on MaxInterview for jsonarray add jsonobject by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "jsonarray add jsonobject"
Braden
03 Jul 2020
1JSONArray array = new JSONArray();
2
3// Create a new JSONObject for every Aufgabe from ArrayList
4for(Aufgabe a : aufgaben) {
5  JSONObject o = new JSONObject();
6  o.put("id", a.getId());
7  o.put("aufgabe", a.getAufgabe());
8  o.put("beschreibung", a.getBeschreibung());
9  o.put("zeit", a.getZeit());
10  array.put(o);
11}