I recently did a coding challenge and was really stuck on how to get the values from a list of strings to be a JSONArray.
Let's say given a list of classes, you want the names of the students to be stored in a JSONArray.
First Grade
Tom
Cat
Ed
Crystal
Second Grade
Phoebe
Cindy
Jill
Matt
Third Grade
Crystal
Ben
Harry
Leo
// To access all the lists in the collection
List<String> classes = new ArrayList<String>(jsonInput.keySet());
After that, do I loop through classes to get the names and put them into a JSONArray?