java - Iterate over a list and put data in hashmap -


I have a list where I need a loop on it and have inserted its data in Hemsap. I am using this approach

 for  (int i = 0; i  

But when I want to read the value from hMap I am doing this way

  archive c = hMap Values ​​(); Iterator IRR = Citrate (); While (IRHASNext ()) {System.out.println ("Next is Val -" + itr.next ()); }  

Next is valid --- is printed com.bean.xyz@23032bc [id = 1] format, I requires precise data, how do i do this?

I'm looking at many problems here

  1. Only get the last list item in the heappap. Because you create a new hash on every repetition, and the reference is lost on the next one.

  2. You need to implement the string method for output in the com.bn.xis class. Desired data member


Comments