Problem in HashSet - Saving object
<p>I have list of product.That list contain check-box &amp; qty in Text-box.IF the user selected particular product need to save that object in HashSet.</p>

<pre><code> CheckBox    Name  Price   Qty
 []          Pen   21    TextBox
 []          aaa   11    TextBox
 []          bbb   25    TextBox
</code></pre>

<p>When the user select the checkbox then save that object into HashSet.</p>

<pre><code>Set&lt;Product&gt; s = new HashSet&lt;Product&gt;();
Product product = new Product();
product.setName("Pen");
product.setPrice(21.00);
product.setName(10);
//s.add(product);
 if(!s.add(product))
    System.out.println("Duplicate detected : " + product);
}
</code></pre>

<p>Problem is : </p>

<p>I selected one particular product.After some time I am changing qty for that saved product.
How we can do it:</p>

<p>How to take saved object &amp; change some property &amp; saved back it.</p>

<p>Please help me...</p>

<p>Thanks in advance..</p>
