O'Reilly logo

Instant GSON by Sandeep Kumar Patel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Top 12 features you need to know about

In this section, you will learn about the top features supported by the GSON library. You will also learn about how to implement these features.

Java objects support

Objects in GSON are referred as types of JsonElement:

Java objects support

The GSON library can convert any user-defined class objects to and from the JSON representation. The Student class is a user-defined class, and GSON can serialize any Student object to JSON.

The Student.java class is as follows:

public class Student { private String name; private String subject; privateint mark; public String getName() { return name; } public void setName(String name) { this.name ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required