Yes, if the put() happens to cause the HashMap to resize itself and copy its contents into a new, larger array, then you can get some completely nonsensical results, including NullPointerException or ArrayIndexOutOfBounds. If you want to use a HashMap from multiple threads, you must either (a) not change its data, (b) use synchronization, or (c) use a
ConcurrentHashMap from JDK 5 or later. Using synchronization may also be accomplished by using Collections.synchronizedMap() or using Hashtable, but in each of these cases you may need additional synchronization - do not assume that just because the individual methods are synchronized, that all problems are solved.