0

What can be the reason to the error in the title?

I import classes from here:

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

And then add watch to the following expression:

(((JSONObject)obj).getJSONArray("userTests")

And then get:

java no such instance method 'org.json.simple.JSONObejct.getJSONArray'

Also when run the code, not by watch expession, I get:

cannot resolve method 'getJSONArray(java.lang.string)'

Jacob G.
  • 28,856
  • 5
  • 62
  • 116
user5260143
  • 1,048
  • 2
  • 12
  • 36
  • 1
    I think you are mixing libraries (calling methods of one, but using the other): https://stackoverflow.com/questions/17941743/org-json-simple-jsonobject-vs-org-json-jsonobject-jsonexception-cannot-be-reso – Juan Oct 28 '18 at 13:22
  • You should copy the exact error messages, not write something from your memory. Further, this problem description is inconsistent. If the compiler can’t resolve a message, it will tell you already at compile-time, without the need to run the code. – Holger Oct 29 '18 at 13:05

0 Answers0