How to modify and delete map objects
<p>I define a Map , and deposited inside objects, I would like to modify the keys inside, the value of the how to modify?
Code is as follows:</p>

<pre><code>package maptest;

/**
 * test Map
 * 
 * @author admin
 *@version 2012.8.29
 */

public class TestA {

private String name;
private String password;
private String idnum;

// name.
public void setName(String name) {
    this.name = name;
}

public String getName() {
    return name;
}

// password

public void setPassword(String password) {
    this.password = password;
}

public String getPassword() {
    return password;
}

// idnum

public void setIdnum(String idnum) {
    this.idnum = idnum;
}

public String getIdnum() {
    return idnum;
}

}

===========================================================

    package maptest;

import java.util.HashMap;
import java.util.Map;

/**
 * Test Map
 * 
 * @author admin
 *@version 2012.8.29
 */

public class TestB {

Map&lt;Object, Object&gt; map = new HashMap&lt;Object, Object&gt;();// map.

public void show() {
    TestA tes = new TestA();
    tes.setName("a");// name
    tes.setPassword("a123");// password
    tes.setIdnum("01");// idnum

    map.put(tes, tes);// add map.

    TestA tes1 = new TestA();

    tes1.setName("b");// name
    tes1.setPassword("a1234");// password
    tes1.setIdnum("02");// idnum

    /*
     * Assuming in accordance setIdnum ("02"), how to delete the name and
     * password of it belongs to?
     */

    map.put(tes1, tes1);// add map.

    TestA tes2 = new TestA();

    tes2.setName("c");// name
    tes2.setPassword("a12345");// password
    tes2.setIdnum("03");

    /*
     * Assuming in accordance setIdnum ("03") to find the name and password,
     * and then modify one of the password, concrete should be how to
     * achieve?
     */

    map.put(tes2, tes2);// add map.
}

public void showmap() {// show map
    for (Object c : map.keySet()) {
        System.out.println("Name&gt;&gt;&gt;:" + ((TestA) map.get(c)).getName());
        System.out.println("Password&gt;&gt;&gt;:"
                + ((TestA) map.get(c)).getPassword());
        System.out.println("Idnum&gt;&gt;&gt;:" + ((TestA) map.get(c)).getIdnum());
        System.out.println("---------------------");
    }
    System.out.println("end.");
}

public static void main(String[] args) {
    // TODO Auto-generated method stub
    TestB te = new TestB();
    te.show();
    te.showmap();
}

}

==========================================
</code></pre>

<p>List and Set delete and modify and Map?</p>
