Object比较# Java - 爪哇娇娃
s*y
1 楼
我记得== 只适用于数值比较
对于Object, 要用 a.equal(b)来进行比较
那么对于下面的的code, "==" 应该返回不等; "e . equal ( f )"应该返回相等
可运行的结果却是两个都不相等
== shows e and f are not equal
e . equal ( f ) shows they are not equal
这是什么原因? 谢谢
对于Object, 要用 a.equal(b)来进行比较
那么对于下面的的code, "==" 应该返回不等; "e . equal ( f )"应该返回相等
可运行的结果却是两个都不相等
== shows e and f are not equal
e . equal ( f ) shows they are not equal
这是什么原因? 谢谢