title: How to deserialize JSON string between JSON.org library using GSON library
body: <p>I have a problem when using GSON library which is json library from Google. Hope someone can give me some hint.</p>
  
  <p>The problem is when I use the gson.fromJson() function trying to convert a json string to a specified defined class.</p>
  
  <p>The example code:</p>
  
  <pre><code>String jsonStr = "{name:"ABC", countries:["US"]}";  // Some Json string.
  Gson gson = new Gson();
  Example example = gson.fromJSON(jsonStr, Example.class);
  
  class Example {
    // does no have no-arg constructor
    private String name;
    private Integer age;
    private JSONArray keywords;  // import org.json.JSONArray;
    private JSONArray countries;
  
    // other codes
  }
  </code></pre>
  
  <p>The above code is simplied version of my problem.
  The problem is in the fromJson() function. The error message is saying "JsonParseException: Expecting object found ["US"]".</p>
  
  <p>I can not figure out what the problem is. I guess maybe gson does not know how to covert a string to JSONArray. Because in here, JSONArray is from another library(org.json). </p>
  
  <p>I try to figure out in the gson documents. It look like I need to write some "Instance Creator" code. </p>
  
  <p>I am wondering whether another can give me some solution.  Thank you.</p>