Iterate over a list and put data in hashmap
<p>I am having a list where i need to loop over it and put its data in hashmap. I am using this approach</p>

<pre><code>for(int i=0;i&lt;list.size();i++) {
    HashMap hMap=new HashMap();
    hMap.put("Data", list);
}
</code></pre>

<p>But when i need to read the value from <code>hMap</code> i am doing in this way</p>

<pre><code>Collection c = hMap.values();
Iterator itr = c.iterator();

while(itr.hasNext()) {
    System.out.println("next val is--"+itr.next());
}
</code></pre>

<p><code>next vali is---</code> is printed in <code>com.bean.xyz@23032bc[id=1]</code> format, i need the exact data, how will i do this?</p>
