Yes. But also you can use Collections.synchronizedMap utility method to make a hashmap thread safe:
Map yourMap = new HashMap();
Map synchronizedMap = java.util.Collections.synchronizedMap(yourMap);
Or you can use ConcurrentHashMap or Hashtable which are thread safe by default.