how to combine two List with the field name in java?
<p>i have two lists namely <strong>plist</strong> and <strong>brlist</strong>. <strong>plist</strong> has the contents of product table and the <strong>brlist</strong> has the pricelist of the brand table.i want to combine bothe list and make a new list.i tried the following code, but it copies the last row value of both lists.</p>

<p>for example,</p>

<p>list <strong>plist</strong> has <strong>product1,product2,product3</strong> with respective <strong>brandnames</strong> and brlist has <strong>product1,product2,product3</strong> with respective prices <strong>price1,price2,price3</strong>.in my case the resultant list has 3 rows with all the values are same <strong>product3 -- brandname3 -- price3</strong> . help me to overcome this error.</p>

<p><strong>CODE :</strong></p>

<pre><code> Map&lt;String, Object&gt; fields = FastMap.newInstance();
 List&lt;Map&lt;String, Object&gt;&gt; products = FastList.newInstance();

   /* actually plist and brlist has the values and displays all the values i checked */

  iter = plist.iterator();
 while (iter.hasNext())

{
  group = iter.next()

  brlist1.add(brlist.price);


  fields.put("productId",group.productId);
  fields.put("brandName",group.brandName);
  fields.put("price",brlist.price);

 products.add(fields);
}
</code></pre>
