Object类中的equals只能在有父类的时候才能使用吗?为什么

public boolean equals(Object obj){

if(this==obj)

return true;

if(obj==null)

return false;

if(getClass()!=obj.getClass())

return false;

Telephone other=(Telephone)obj;

if(CPU!=other.CPU)

return false;

return true;

}


weibo_快乐is魏帆_0
浏览 1412回答 1
1回答

sunyx

没有父类也可以用啊。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java