title: get Json values from a JsonArray inside a Json in Java using Map
body: <p>i need to access the values of a Json, that its inside an Array, that its inside of a Json, the structure of the Json file its like this:</p>
  <pre><code>{
      &quot;Places&quot;: [
      {
          &quot;id&quot;: 17,
          &quot;city&quot;: &quot;Chicago&quot;,
          &quot;vehicle&quot;: &quot;car&quot;
      },
      {
          &quot;id&quot;: 13,
          &quot;city&quot;: &quot;New York&quot;,
          &quot;vehicle&quot;: &quot;plane&quot;,
      }
      ]
  }
  </code></pre>
  <p>i only need the values of &quot;id&quot;, &quot;city&quot; and &quot;vehicle&quot;
  im using the map function like this:</p>
  <pre><code>Gson gson = new Gson();
  Map&lt;String,String&gt; userMap = gson.fromJson(contentoffile, Map.class);
          
          for (Object value : userMap.values()) {
              Map places= (Map) value;
              
              int id = (int) (places.get(&quot;id&quot;));
              String city= (String) places.get(&quot;city&quot;);
              String vehicle= (String) places.get(&quot;vehicle&quot;);
  </code></pre>
  <p>but i got the next error</p>
  <pre><code>Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map
  </code></pre>
  <p><strong>how i can acces the data?</strong>
  btw, i can use other libraries for this, not only Map function</p>