Reputation: 715
I imported the following imports to my code, however I still get an error for
JsonObject obj = new JsonParser().parse(input).getAsJsonObject();
"JsonObject cannot be resolved for a type."
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.json.JSONArray.*;
import org.json.JSONException;
import org.json.JSONObject.*;
import org.json.JSONString;
Upvotes: 0
Views: 2315
Reputation: 1690
Its JSONObject
not JsonObject
.
Same goes for the parser, it's JSONParser
not JsonParser
.
JSON is always uppercase.
Upvotes: 4