title: Reading JSON file using json-smart
body: <p>I am trying to read the values from a JSON file to array for further processing. I am using JSON-Smart 1.2.0 library for the same. Due to some restrictions, I can not use the 2.0 version.</p>
  
  <p>I am getting the following exception.</p>
  
  <pre><code>java.lang.ClassCastException: net.minidev.json.JSONArray cannot be cast to net.minidev.json.JSONObject
  </code></pre>
  
  <p>I am even tried using JSONArray instead of JSONObject. What I am doing wrong over here? Is this correct way to read json content?</p>
  
  <p>Below is the java code.</p>
  
  <pre><code>JSONObject json = (JSONObject) JSONValue.parseWithException(browsers);
  JSONArray array = (JSONArray) json.get("friends");
  
  for (int i = 0; i &lt; array.size(); i++) {
      JSONObject cap = (JSONObject) array.get(i);
      String first = (String) cap.get("name");
      System.out.println(first);
  }
  </code></pre>
  
  <p>Below is the json file content.</p>
  
  <pre><code>[
    {
      "friends": [
        {
          "id": 0,
          "name": "test1"
        },
        {
          "id": 1,
          "name": "test2"
        }
      ]
    }
  ]
  </code></pre>