Elements in java ArrayList taking up two places
<p>I have made a LinkedList to store State objects which is a class I have created. I can add states to the list as expected, but whenever I try the size() method on the list it always returns twice the amount of elements I have added. Why is it doing this and how can I then use the get(n) method if each element has 2 values of n?</p>

<p>Here's the code used to create and add to the list:</p>

<pre><code>static ArrayList&lt;State&gt; stateTable = new ArrayList&lt;State&gt;();
stateTable.add(new State(new Item(0,0)));
</code></pre>

<p>I will add that the adding to the list is done inside the constructor for State objects so that all created States get put in the stateTable.
Thanks</p>
