Generate Pretty Print JSON String in Java using Gson
In this Java Gson tutorial we learn how to use the Gson library to generate a readable pretty print JSON String from a Java object. Via Java detail Java example we will show you how to use the GsonBuilder.setPrettyPrinting() method to configure Gson to output JSON String that fits in a page for pretty printing.