1231 and 1237 are just two (sufficiently large) arbitrary prime numbers. Any other two large prime numbers would do fine. When computing hash codes for composite objects it's common to add the hash codes for the components. If too small values are used in a hash set with a large number of buckets there's a risk of ending up with an uneven distribution of objects.
点赞 4

相关推荐

想问问各位大佬,同时拿到了美团和虾皮的前端实习,该怎么选呀?
寒小枫:实习选美团 秋招同薪资选虾皮
投递美团等公司10个岗位 >
点赞 评论 收藏
分享
牛客网
牛客企业服务