I have to check whether the given value is JSONObject or not.... example input :
Object obj = "{} testing"
i am checking with below code:
public boolean isJSONValid(Object obj) {
try {
new JSONObject(obj);
} catch(JSONException e) {
return false;
}
return true;
}
but for above input it is giving true, am using org.json jar file.