title: JAVA - json parser - keys() to parse unknown json format?
body: <p>I try to parse a simple json dictionary, so I read many tutorials and threads on how to achieve this</p>
  
  <p>but there is no "keys()" nor "keySet()" defined for JSONObject nor JSONArray</p>
  
  <p>I downloaded the library here :</p>
  
  <pre><code>http://www.java2s.com/Code/Jar/j/Downloadjsonsimple111jar.htm
  </code></pre>
  
  <p>I am starting to wonder if I use the right library</p>
  
  <p>here is my code :</p>
  
  <pre><code>import org.json.simple.parser.ParseException;
  import org.json.simple.parser.JSONParser;
  import org.json.simple.JSONArray;
  import org.json.simple.JSONObject;
  
  JSONParser parser = new JSONParser();
  JSONObject obj = (JSONObject)parser.parse(json.trim());
  Iterator keys = obj.keys(); &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; keys() undefined
  while(keys.hasNext()) {
      String key = keys.next();
  }
  </code></pre>
  
  <p>json example :</p>
  
  <pre><code>{a:132,b:"1321",test:"something"}
  </code></pre>
  
  <p>any help appreciated</p>
  
  <p>thanks</p>