【发布时间】:2014-02-03 00:39:40
【问题描述】:
为什么这段代码返回true:
new Byte() == new Byte() // returns true
但此代码返回 false:
new Byte[0] == new Byte[0] // returns false
【问题讨论】:
-
我很惊讶没有人发现这个问题的重复,因为它是非常基本的 value 类型的诗句而不是 reference 类型的问题。
-
我对它获得的赞成票数量感到更加惊讶——截至目前为 51 个。