阅读背景:

当在Java中重写等于时,为什么不使用对象之外的参数呢?

来源:互联网 

I ran into an interesting behavior recently. It seems that if I override .equals() to take a parameter other than Object, it doesn't get called. Can anyone explain to me why this is happening? It seems to violate my understanding of polymorphism in OOP, but maybe I'm missing something.I ran into an interesting behavior recently. It




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: