I've found some example here which says how to convert json to java object but here I need to convert Java object to GSON
I have a Java object and now I want to convert the Java object to Gson. How can I achieve this, please refer my code.
Staff obj = new Staff();
Gson gson = new Gson();
I need to convert staff object to gson object
This is my staff class
public class Staff {
private String name;
private int age;
private String position;
private BigDecimal salary;
private List<String> skills;
How can I go about this?