In the post we will show what problems Java Date has. In Java 1.0 only support for date and time was the java.util.Date class. The usability of this class is harmed by some wrong design decisions.
In this example we will show you how to convert java object to JSON using Gson library. Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object.