Advantages of using a HashSet over HashMap
问题 According to JavaDoc API a HashSet is just a wrapper around a HashMap. Therefore can there ever be any performance benefit to using a HashSet over a HashMap. Ever? Ever? Or is just to have a different API which suits other cases? 回答1: No, there's no "performance" benefit; there's just the benefit that comes from using the right API for the right problem...which is considerable. 回答2: Not Really there are no Performance benefits, They both serves for the different purpose. About Hashset in API