java.util.IdentityHashMap.put() 方法


java.util.IdentityHashMap.put() 方法

package com.codingdict;

import java.util.*;

public class IdentityHashMapDemo {
   public static void main(String args[]) {

      // create identity hash map
      IdentityHashMap ihmap = new IdentityHashMap();

      // populate the map
      ihmap.put(1, "java");
      ihmap.put(2, "util");
      ihmap.put(3, "package");

      System.out.println("Initial map: " + ihmap);

      // put value at key 2
      ihmap.put(2, "awt");

      System.out.println("Map after modification: " + ihmap);
   }    
}