This is a short tutorial on how to use GSon to work with Java Json objects like serializing and deserializing.
Json is wildly used in all application hence learning about it is very important.
To work with GSon start by initializing the GSon object with relevant methods.
import com.google.gson.Gson;
import com.stemgon.models.Product;
Gson gson = new Gson();
var s = gson.toJson(Product);
System.in.out.println(s);
You can also use this method;
import com.google.gson.GsonBuilder;
GsonBuilder gsonBuilder = new GsonBuilder();
var gson = gsonBuilder.create();