Best way to initialize a HashMap
问题 I usually do e.g. HashMap<String,String> dictionary = new HashMap<String,String>(); I started to think about it, and as far as I know a HashMap is implemented under the hood via a hash table. The objects are stored in the table using a hash to find where they should be stored in the table. Does the fact that I do not set a size on the construction of the dictionary makes the performace decrease? I.e. what would be the size of the hash table during construction? Would it need to allocate new