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

相关推荐

VirtualBool:都去逗他了?
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务