Like This Site? 
 
RSS Feed Follow Us 

on Twitter! Be Our Fan!

Creating JSON document using Java and GSON API

Share this post!
 Vote this!

In this post we would take a look at how the same GSON API can be used to create JSON from the Java objects. Please read this to get an idea of what GSON is. Diving right into the topic of this example, we would make use of the toJson method of com.google.gson.Gsonclass. One of the overloaded versions of toJson() takes in an source of type Object and the type information which is of class java.lang.reflect.Type.more...

0 comments:

Post a Comment