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)'

2
  • 1
    I think you are mixing libraries (calling methods of one, but using the other): stackoverflow.com/questions/17941743/… Commented Oct 28, 2018 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. Commented Oct 29, 2018 at 13:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.