title: How to add an object as a property of a JsonObject object?
body: <p>Here is what I am doing:</p>
  
  <pre><code>JsonObject jobj = new JsonObject();
  jobj.addProperty("name", "great car");
  </code></pre>
  
  <p>I am hoping to add another property whose value is an object as follows:</p>
  
  <pre><code>jobj.addProperty("car", A_CAR_OBJECT);
  </code></pre>
  
  <p>But it appears that GSON does not allow me to do <code>jobj.addProperty("car", A_CAR_OBJECT)</code>. I am going to eventually do the following:</p>
  
  <pre><code>String json = new Gson().toJson(jobj);
  </code></pre>
  
  <p>to get the Json string.</p>
  
  <p>Is this doable? Am I using GSON the right way? Or should I just use a <code>HashMap</code> to throw all data into it and then <code>new Gson().toJson()</code>?</p>