Java HashMap Create newHashMap()

Here you can find the source of newHashMap()

Description

new Hash Map

License

Apache License

Declaration

public static <K, V> HashMap<K, V> newHashMap() 

Method Source Code

//package com.java2s;
/*//w  w  w. ja  va2s .  com
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
 */

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static <K, V> HashMap<K, V> newHashMap() {
        return new HashMap<K, V>();
    }

    public static <K, V> HashMap<K, V> newHashMap(int size) {
        return new HashMap<K, V>(size);
    }

    public static <K, V> HashMap<K, V> newHashMap(Map<K, V> map) {
        return new HashMap<K, V>(map);
    }
}

Related

  1. newHashMap()
  2. newHashMap()
  3. newHashMap()
  4. newHashMap()
  5. newHashMap()
  6. newHashMap()
  7. newHashMap()
  8. newHashMap(final int initCapacity)
  9. newHashMap(final int size)