title: ClassCastException Parsing string to JSONArray
body: <p>I have a JSON string like the one below being returned from a REST app to an Android app:</p>
  
  <pre><code>"{ \"error\" : false , \"volume\" : 1000 }"
  </code></pre>
  
  <p>I then try to parse out the response with following (not the exact function, but the exact code causing trouble):</p>
  
  <pre><code>import org.json.simple.JSONArray;
  import org.json.simple.JSONObject;
  import org.json.simple.parser.JSONParser;
  
  public void jsonFunction(String result){
      JSONArray jsonArr = (JSONArray) new JSONParser().parse(result);
      JSONObject json = (JSONObject) jsonArr.get(0);
  }
  </code></pre>
  
  <p>However, every time I try to parse the JSON string, I get the following error:</p>
  
  <pre><code>java.lang.String cannot be cast to org.json.simple.JSONArray
  java.lang.ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONArray
  </code></pre>
  
  <p>I've used the same code to parse a JSON response from another REST app within the same program, but that one executes without any trouble. If I try to parse directly to a JSONObject, I get a very similar error message. I figure there has to be something I'm not seeing, but for the life of me I can't quite seem to determine what it is.</p>
  
  <p>EDIT:</p>
  
  <p>This is what I get trying to parse directly to a JSON object:</p>
  
  <pre><code>java.lang.String cannot be cast to org.json.simple.JSONObject
  java.lang.ClassCastException: java.lang.String cannot be cast to org.json.simple.JSONObject
  </code></pre>