Java HashMap Create newHashMap(int size)

Here you can find the source of newHashMap(int size)

Description

new HashMap and initialCapacity

License

Apache License

Parameter

Parameter Description
size a parameter

Declaration

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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;

public class Main {
    /**//from w  ww  .  ja v  a 2 s.co  m
     * new HashMap
     * @return
     */
    public static <K, V> HashMap<K, V> newHashMap() {
        return new HashMap<K, V>();
    }

    /**
     * new HashMap and initialCapacity
     * @param size
     * @return
     */
    public static <K, V> HashMap<K, V> newHashMap(int size) {
        return new HashMap<K, V>();
    }
}

Related

  1. newHashMap(final int initCapacity)
  2. newHashMap(final int size)
  3. newHashMap(final K key, final V value)
  4. newHashMap(int capacity)
  5. newHashMap(int size)
  6. newHashMap(int size)
  7. newHashMap(K[] keys, V[] values)
  8. newHashMap(K[] keys, V[] values)
  9. newHashMap(Map.Entry... entries)