Converting JSON to Java object using Gson

前端 未结 2 514
[愿得一人]
[愿得一人] 2021-02-06 11:25

I am trying to convert JSON string to simple java object but it is returning null. Below are the class details.

JSON String:

   {\"menu\": 
    {\"id\":          


        
2条回答
  •  失恋的感觉
    2021-02-06 11:36

    What I have found helpful with Gson is to create an an instance of the class, call toJson() on it and compare the generated string with the string I am trying to parse.

提交回复
热议问题