convert java object to JSON string

In this post, we will learn to convert java object to JSON string using GSON library We can convert Java object to json string using below dependency Dependency Syntax Example Student.java Output Github https://github.com/rkumar9090/student-example/blob/master/src/main/java/com/beginnersbug/example/ConvertJavaToJson.java Related Articles convert JSON string to java object