相关疑难解决方法(0)

如何实现hashCode和equals方法

我应该如何实施hashCode()equals()在Java下面的类?

class Emp 
{
  int empid ; // unique across all the departments 
  String name;
  String dept_name ;
  String code ; // unique for the department 
}
Run Code Online (Sandbox Code Playgroud)

java equals hashcode

25
推荐指数
1
解决办法
3万
查看次数

标签 统计

equals ×1

hashcode ×1

java ×1