回复 楼主 诸葛修勤
iiiiiiiiiiiiiiiiiiiiiiiiiii
2011-04-27 16:53
不好意思 水平有限看不懂
2011-04-27 17:25
程序代码: public boolean equals(Object student){
if(!(student instanceof StudentMsg)){
return false;
}
StudentMsg tmp = (StudentMsg)student;
if(this.m_id.equals(tmp.m_id) && this.m_mark == tmp.m_mark && this.m_name.equals(tmp.m_name)){
return true;
}else
return false;
}看你的代码有一种看老手写的感觉。。。很羡慕。。。
2011-04-27 21:05
2011-04-27 21:09
2011-04-27 21:50
程序代码: public boolean equals(StudentMsg tmp)
{
//StudentMsg tmp = (StudentMsg)student;
if(this.m_id.equals(tmp.m_id) && this.m_mark == tmp.m_mark && this.m_name.equals(tmp.m_name))
{
return true;
}
else
{
return false;
}
}改成这样没有用: 是不是没有保持函数签名一样 所以说这是重载 而不是重写
2011-04-27 21:52
2011-04-28 10:52
2011-04-28 15:49