title: merging two json objects into single object in java
body: <p>I have two json objects like below:</p>
  
  <pre><code>{"name":["Karbonn Smart A12 Star (Black &amp; Silver)","Nokia 220 (Black)","Karbonn Smart A52 Plus (Black &amp; Gold)","Karbonn Smart A12 Star (White &amp; Gold)",.......]}
  {"price":["Rs. 3,699","Rs. 2,599","Rs. 2,499","Rs. 3,699",..........]}
  </code></pre>
  
  <p>I would like to combine both the objects like below I tried by using nested for each loop it did not worked I am not knowing the procedure to achieve this:</p>
  
  <pre><code>{"mobile":[{"name":"Karbonn Smart A12 Star (Black &amp; Silver)","price":"Rs. 2,499"}]...........}
  </code></pre>
  
  <p>my code is below:</p>
  
  <pre><code>for(Element a:mobilename)
      {
      text= a.text();
      arr.add(text);
      obj1.put("name", arr);
      //a11.add(text);
  
  }
     arr2.add(obj1);
  
      for(Element b:price)
      {
      text1=b.text();
      arr1.add(text1);
  
      obj.put("price", arr1);
  
  
  
  
       }
      arr2.add(obj1);
      arr2.add(obj);
      obj2.put("mobile", arr2);
  </code></pre>