title: How to get all keys from a JSON-Object as a String array in Java
body: <br>
  I have a JSON Object which I created from a .json file which looks like the follownig:
  <pre><code>{
    &quot;key1&quot;: {
      &quot;key2&quot;: &quot;value2&quot;,
      &quot;key3&quot;: &quot;value3&quot;,
    }
  }
  </code></pre>
  <p>To generate the JSON-Object I use:</p>
  <pre><code>JSONObject newJSON = new JSONObject(content);
  </code></pre>
  <p>What I want to do, is to generate a String array, which contains all keys of the existing JSONObject, to easily access them.</p>