title: Check whether a value exists in a JSON object using Java
body: <p>I'm very new to Java and trying to find and check whether a particular value exists in JSON object. Here is my code,</p>
  
  <pre><code>String strUsers = representation.getText();     
  JSONObject jsonObject = new JSONObject(strUsers);
  
      Iterator&lt;String&gt; keys = jsonObj.keys();
      while(keys.hasNext()) {
          String key = keys.next();
          String val = null;
          try {
               JSONObject value = jsonObj.getJSONObject(key);
  
          } catch(Exception e) {
  
          }
      }
  </code></pre>
  
  <p>Further I'm not able to understand how to check. Can any one guide me in achieving my goal? </p>