I am getting this compilation error:
cannot find symbol Constructor JSONObject(java.lang.String)
Can any one explain what is wrong with it?
String jsnString = new String("{\"fname\":\"DKP\",\"lname\":\"patel\"}");
JSONObject jObj = new JSONObject(new String(jsnString));
I also tried with:
JSONObject jObj = new JSONObject(jsnString);
You should check to see if it is correctly linked and imported. Can you use any of the other classes / static methods in the class?