title: How to make JSON object of JSON objects
body: <p>I have been working with a few JSON objects and have been keeping the outer JSON an array, but is it possible to keep the outer a JSON object and have it contain other JSON objects or arrays?</p>
  
  <p>This is what I have and it is in proper form and works well:</p>
  
  <pre><code>{
  "outer":[{
    "profile":{
       "image":"",
       "name":"",
       "password":"",
       "favorites":[
  
       ]
    },
    "friends":[
       {
          "name":"",
          "image":"",
          "number":"",
          "type":"",
          "birthday":"",
          "state":""
       }
    ]
  }]
  }
  </code></pre>
  
  <p>However, is it possible to have this:</p>
  
  <pre><code>{
  "outer":{
    "profile":{
       "image":"",
       "name":"",
       "password":"",
       "favorites":[
  
       ]
    },
    "friends":[
       {
          "name":"",
          "image":"",
          "number":"",
          "type":"",
          "birthday":"",
          "state":""
       }
    ]
  }
  }
  </code></pre>
  
  <p>This is also in proper form, but I am having trouble adding multiple JSON objects and JSON arrays to a single JSON object in Android.  Every time I have the outer JSON object, it overwrites whichever object is already in there when I add another one.  </p>
  
  <p>This is what I've got so far.  obj1 is the profile JSON object and obj2 is the friends JSON object:</p>
  
  <pre><code>JSONObject profile = new JSONObject();
  profile.put("profile", obj1);
  JSONObject friends = new JSONObject();
  friends.put("friends", obj2);
  JSONObject outer = new JSONObject():
  outer.put("outer", profile);
  outer.put("outer", friends);
  </code></pre>