title: Java: Convert a nested JSON file into a single, nexted ArrayList
body: <p>I'm looking to convert a nested JSON file into one single, nexted Java ArrayList.</p>
  
  <p>Here is a snippit of my JSON file:</p>
  
  <pre><code>[
      {
          "dex": "001",
          "name": "Bulbasaur",
          "types": [
              "Grass",
              "Poison"
          ],
          "attack": 128,
          "defense": 118,
          "HP": 111,
          "catchRate": 0.2,
          "fleeRate": 0.1,
          "candy": 25,
          "fastMoves": [
              "Vine Whip",
              "Tackle"
          ],
          "chargeMoves": [
              "Seed Bomb",
              "Sludge Bomb",
              "Power Whip"
          ]
      },
      {
          "dex": "002",
          "name": "Ivysaur",
          "types": [
              "Grass",
              "Poison"
          ],
          "attack": 155,
          "defense": 151,
          "HP": 143,
          "catchRate": 0.1,
          "fleeRate": 0.07,
          "candy": 100,
          "fastMoves": [
              "Vine Whip",
              "Razor Leaf"
          ],
          "chargeMoves": [
              "Sludge Bomb",
              "Solar Beam",
              "Power Whip"
          ]
      }
  ]
  </code></pre>
  
  <p>And here is the Java I have so far:</p>
  
  <pre><code>JSONParser parser = new JSONParser();
          JSONObject jsonObject = null;
  
          try {
              JSONArray jo = (JSONArray) parser.parse(new FileReader(filePath));
  
              ArrayList&lt;JSONObject&gt; pokemons = new ArrayList&lt;JSONObject&gt;();
  
              for (int i = 0; i &lt; jo.size(); i++) {
                  JSONObject pokemon = (JSONObject) jo.get(i);
                  pokemons.add(pokemon);
              }
  
  
              return pokemons;
  
          } catch (ParseException | IOException e) {
              System.out.println("File not found.");
              return null;
          }
      }
  </code></pre>
  
  <p>Currently, my Java allows one to access any value from any dictionary item. Though, I am unable to access any item within any of the lists within any dictionary ("types", "fastMoves", "chargeMoves"). How do I parse this info so I can access the list items of these lists?</p>
  
  <p><strong>For example, how can I edit my main ArrayList so that, when calling it by doing: <code>pokemons.get(1).get(“types”).get(1)</code>, it will return <code>“Poison”</code>?</strong></p>