Not getting desired output for ArrayList elements, could any one clarify?
<p>I have defined the arraylist as follows:</p>

<pre><code>ArrayList&lt;Node&gt; nodes = new ArrayList&lt;Node&gt;();
</code></pre>

<p>Where Node is a class which has one character data type for storing a single character.</p>

<p>The output is showing some garbage value instead of printing characters:</p>

<p>Here is a code snippet. Can anyone explain why?</p>

<pre><code>for(Node d : nodes){
    System.out.println(d);
}
</code></pre>
