Creating GSON Object

JsonObject innerObject = new JsonObject();
innerObject.addProperty("name", "john");

JsonObject jsonObject = new JsonObject();
jsonObject.add("publisher", innerObject);

http://www.javadoc.io/doc/com.google.code.gson/gson


Just an FYI: Gson is really made for converting Java objects to/from JSON. If this is the main way you’re using Gson, I think you’re missing the point.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)