摘要
每个Java对象都有hashCode()和equals()方法.实践中常常需要重构这些方法,以满足对象实例之间提供更深层次的语义可比性.介绍了在创建Java类时有效和准确定义hashCode()和equals()时应遵循的规则和指南.
Every Java object has methods of hashCode() and equals(). These methods often need to be reconstructed to satisfy the relation between object instances. This paper introduces the rules in defining hashCode( )and equals() when creating Java class.
出处
《吉林建筑工程学院学报》
CAS
2007年第3期44-46,共3页
Journal of Jilin Architectural and Civil Engineering