java.util.IdentityHashMap.containsKey() の使い方

Javaコード
package Permission;
import java.util.IdentityHashMap;

public class IdentityHashMapDemo {

@SuppressWarnings(“unchecked")
public static void main(String[] args) {
// create identity hash map
@SuppressWarnings(“rawtypes")
IdentityHashMap cft = new IdentityHashMap();

// populate the map
cft.put(1, “品川区");
cft.put(2, “大田区");
cft.put(3, “新宿区");

// check if key 3 exists
boolean isavailable=cft.containsKey(3);

System.out.println(“Is key '3’ exists: " + isavailable);
}

}

実行結果
Is key '3’ exists: true

Java

Posted by arkgame