I followed this link and found that one of the answer says that we can create a JSON object by using this constructor:
JSONObject jsonObj=new JSONObject(String_to_Be_Parsed);
But when I downloaded the library of JSON and put that jar in my project I found that it supports only two constructors namely:
JSONObject()
JSONObject(boolean)
Although the documentation in the site of JSON also have a number of constructors including the one I want, JSONObject(String)?
What should I do?
The link provided by the comment to that answer apparently was not the correct source (note that the comment had a different author than the answer). I have added a comment to correct it. The correct source is probably here: http://json.org/java/. (Actually it looks like there are numerous 3rd party implementations and this is just a reference implementation. It looks like it would work, except you have to build your own .jar apparently.)
You can see the
JSONObject(String)constructor right in the source for JSONObject.java.