title: How to read json file (array form) using simple JSON library?
body: <p>Actually, The example below is an answer somewhere in StackOverFlow.
  I tried to use the below code, but,</p>
  
  <pre><code>JSONArray a = (JSONArray) parser.parse(new FileReader("c:\\exer4-courses.json"));
  </code></pre>
  
  <p>Above line doesn't work because of the below Exception.</p>
  
  <pre><code>java.lang.ClassCastException: org.json.simple.JSONObject cannot be cast to org.json.simple.JSONArray
  </code></pre>
  
  <p>Is there any way to read my JSON file?</p>
  
  <p>JSON file:</p>
  
  <pre><code>[
      {
          "name": "John",
          "city": "Berlin",
          "cars": [
              "audi",
              "bmw"
          ],
          "job": "Teacher"
      },
      {
          "name": "Mark",
          "city": "Oslo",
          "cars": [
              "VW",
              "Toyata"
          ],
          "job": "Doctor"
      }
  ]
  </code></pre>
  
  <p>Java code:</p>
  
  <pre><code>JSONArray a = (JSONArray) parser.parse(new FileReader("c:\\exer4-courses.json"));
  
  for (Object o : a) {
      JSONObject person = (JSONObject) o;
  
      String name = (String) person.get("name");
      System.out.println(name);
  
      String city = (String) person.get("city");
      System.out.println(city);
  
      String job = (String) person.get("job");
      System.out.println(job);
  
      JSONArray cars = (JSONArray) jsonObject.get("cars");
  
      for (Object c : cars) {
        System.out.println(c + "");
      }
    }
  </code></pre>