Cannot display ArrayList
<p>I am doing a heavy operation with arrayList of arrayLists. when I am trying to display the parent array list, I have a problem that it's displaying empty arraylists as below</p>

<p>My arrayList declaration is hereunder</p>

<pre><code>List&lt;List&lt;String&gt;&gt; arrayList = new ArrayList&lt;List&lt;String&gt;&gt;();
</code></pre>

<p>Here is my child list</p>

<pre><code>List&lt;String&gt; stringLine = new ArrayList&lt;String&gt;();
</code></pre>

<p>In my program I am adding this stringLine to arrayList like this</p>

<pre><code>arrayList.add(stringLine);
</code></pre>

<p>My output when trying to print parent arrayList
printing size of arrayList so far 44 content is : <code>[[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]</code></p>

<p>Note: In the above output 44 is the no of arrayList elements it has</p>

<p>When I try to print the child it displays good</p>

<pre><code>StringLine is : [1640, 1138, 878, 1600, 1978, 280, 24, 2509, 702, 553, 2362, 2019, 1558, 2494, 823, 35, 1181, 1915, 1261, 1448, 493, 798, 1160, 651, 2249, 1639, 2428, 458, 2556, 939, 2114, 2339, 2373, 286, 2078, 844, 2673, 1486, 1657, 1531, 1043, 734, 2247, 2121, 75, 2599, 975, 29, 175, 960, 2151, 480, 868, 2627, 1941, 671, 2529, 1952, 1623, 2160, 2298]
</code></pre>

<p>Where, I was wrong?</p>

<p><strong>UPDATE:</strong></p>

<p>Here is my code snippet, where in I am adding a list to the parent arrayList</p>

<pre><code>private void splitString(String temp) {
    System.out.println("In splitString method..");
    List&lt;String&gt; stringLine = new ArrayList&lt;String&gt;();
    StringTokenizer stringTokenizer = new StringTokenizer(temp, " ");
    while (stringTokenizer.hasMoreTokens()) {
        stringLine.add(stringTokenizer.nextToken());
    }
    if (stringLine.size() != 3) {
        arrayList.add(stringLine);
    }
    stringLine.clear();
}
</code></pre>
