Reputation: 61
I made a JSONArray
object but can't seem to call the .put method on it. Does anyone know why?
Upvotes: 0
Views: 745
Reputation: 14988
It should be prevjobs.add("name");
since JSONArray
extends ArrayList
, and that's how items are added to an ArrayList
.
Also, check the unofficial javadocs, section Methods inherited from class java.util.ArrayList.
Finally, if you do Ctrl + Space after prevjobs.
you can see the available methods from the JSONArray
API.
Upvotes: 2