課程
/后端開發
/Java
/Java入門第三季
這里的重寫equals方法能不能用系統自動重寫
2017-09-05
源自:Java入門第三季 6-1
正在回答
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
Student other = (Student) obj;
if (name == null) {
if (other.name != null)
} else if (!name.equals(other.name))
}
手寫把模版給你自己改
不脫發的小Java 提問者
舉報
Java中你必須懂得常用技能,不容錯過的精彩,快來加入吧
1 回答equals方法重寫
2 回答重寫equals方法
2 回答關于重寫equals方法的疑問
1 回答6-1節關于重寫equals方法的問題
1 回答在最后重寫的equals方法
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-09-06
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Student other = (Student) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
手寫把模版給你自己改