title: In Java, how can I combine two JSON arrays of objects?
body: <p>I have several string each containing a JSON representation of an array of objects.  Here's an example in code to illustrate, though this is not my actual code (the JSON strings are passed in):</p>
  
  <pre><code>String s1 = "[{name: "Bob", car: "Ford"},{name: "Mary", car: "Fiat"}]";
  String s2 = "[{name: "Mack", car: "VW"},{name: "Steve", car: "Mercedes Benz"}]";
  </code></pre>
  
  <p>I need to combine those two JSON arrays into one large JSON array.  I could treat this as a String manipulation problem and replace the inner end square brackets with commas but that's not particularly robust (though I am guaranteed to get valid JSON).</p>
  
  <p>I'd rather treat these two Strings as JSON arrays and just add them together somehow.  It's a great plan except I don't know the "somehow" part.</p>
  
  <p>Does anyone know a solution in Java that doesn't require constructing Java Object representations of the JSON objects?</p>
  
  <p>Thanks!</p>