title: Using GSON to parse array with multiple types
body: <p>I wish to use GSON to parse the following json:</p>
  
  <pre><code>[
      [
          "hello",
          1,
          [2]
      ],
      [
          "world",
          3,
          [2]
      ]
  ]
  </code></pre>
  
  <p>So, that's 1 array, containing 2 arrays.  The 2 inner arrays are themselves arrays, comprised of String, int, array types.</p>
  
  <p>I'm unsure how I can using Java classes to model the array which has 3 different types (String, int, array).  I start with:</p>
  
  <pre><code>// String json just contains the aforementioned json string.
  
  ArrayList&lt;ArrayList&lt;XXX&gt;&gt; data = new ArrayList&lt;ArrayList&lt;XXX&gt;&gt;();
  
  Type arrayListType = new TypeToken&lt;ArrayList&lt;ArrayList&lt;XXX&gt;&gt;&gt;(){}.getType();
  
  data = gson.fromJson(json, arrayListType);
  </code></pre>
  
  <p>But what should be where the 'XXX' are?  I think it should be an array, but it should be an array with 3 different data types.  So how can I use Java to model this?</p>
  
  <p>Can any help?
  Thank you.</p>