title: Java. Praoblem with org.json
body: <p>I have Json string, which contain "key" : "value" pairs and i need to know keys at this string  using Java and importing org.json. I tried to use iterator, but first pair key prints in the end. </p>
  
  <p>for example string:</p>
  
  <pre><code>{
     "firstName": "sam",
     "lastName": "Smith",
     "address": {
         "streetAddress": "somestreet",
         "city": "somecity",
         "postalCode": 101101
     },
     "phoneNumbers": [
         "812 123-1234",
         "916 123-4567"
     ]
  }
  </code></pre>
  
  <p>I want to print:
  "
  firstName
  lastName
  address
  phoneNumbers
  ".
  But i have: 
  "lastName
  address
  phoneNumbers
  firstName"  </p>
  
  <pre><code> JSONObject JO = new JSONObject(JsonString);
      Iterator&lt;String&gt; It = JO.keys();
  
         while (It.hasNext()){        
         System.out.println(It.next());
         }
  </code></pre>