class Employee{public boolean equals(Object otherObject){if (this ==otherObject) return true;if(otherObject ==null) return false;if(getClass()!=otherObject.getClass())return false;Employee other =(Employee)otherObject;return name.equals(other.name)&&salary==other.salary&&hireday.equals(other.hireday);}}他第三部已经比较两者类是否相同,为什么后面又强制类型转换。??,直接拿otherObject不行吗??求大神指教
添加回答
举报
0/150
提交
取消