0

I made a JSONArray object but can't seem to call the .put method on it. Does anyone know why?

Code screenshot

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80
Kevin
  • 61
  • 8

1 Answers1

2

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.

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80