JSONObject jsonObj = new JSONObject();
jsonObj.put("name","raja");
Declare the jsonobject var(jsonObj) and gave value("name","raja") using above code.
System.out.println(jsonObj.name);
Just print the name but it shows the error.
JSONObject jsonObj = new JSONObject();
jsonObj.put("name","raja");
Declare the jsonobject var(jsonObj) and gave value("name","raja") using above code.
System.out.println(jsonObj.name);
Just print the name but it shows the error.
try this:
System.out.println(jsonObj.getString("name"));