課程
/后端開發(fā)
/Java
/Java入門第三季
這里的重寫equals方法能不能用系統(tǒng)自動(dòng)重寫
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))
}
手寫把模版給你自己改
不脫發(fā)的小Java 提問者
舉報(bào)
Java中你必須懂得常用技能,不容錯(cuò)過的精彩,快來加入吧
1 回答equals方法重寫
2 回答重寫equals方法
2 回答關(guān)于重寫equals方法的疑問
1 回答6-1節(jié)關(guān)于重寫equals方法的問題
1 回答在最后重寫的equals方法
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
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;
}
手寫把模版給你自己改