Create new Identity Hash Map - Java java.util

Java examples for java.util:Collection Creation

Description

Create new Identity Hash Map

Demo Code


//package com.java2s;

import java.util.IdentityHashMap;

import java.util.Map;

public class Main {
    public static void main(String[] argv) {
        System.out.println(newIdentityHashMap());
    }//ww  w. j  av a  2  s  .  c  o m

    public static <K, V> IdentityHashMap<K, V> newIdentityHashMap() {
        return new IdentityHashMap<K, V>();
    }

    public static <K, V> IdentityHashMap<K, V> newIdentityHashMap(
            final int expectedMaxSize) {
        return new IdentityHashMap<K, V>(expectedMaxSize);
    }

    public static <K, V> IdentityHashMap<K, V> newIdentityHashMap(
            final Map<? extends K, ? extends V> m) {
        return new IdentityHashMap<K, V>(m);
    }
}

Related Tutorials