只有b,e对,
a, 错 对象与基本类型不能用==
b, 对 自己等于自己当然多
c, 错 两个对象只有地址相同才相等==
d: 错 equals的参数应该是对象
f: 对
e: 错 equals的参数应该是对象
a, 错 对象与基本类型不能用==
b, 对 自己等于自己当然多
c, 错 两个对象只有地址相同才相等==
d: 错 equals的参数应该是对象
f: 对
e: 错 equals的参数应该是对象
==必须两边的类型一样,所以A,C都不可能。equals()需要Object 为参数,D,F又错了。E可以编译成功,但返回FALSE。所以只有B。
To zych72(闹闹)
F对吗?它的确可以编译通过,可怎么可能返回True呢?
Compares this object against the specified object. The result is true if and only if the argument is not null and is a Double object that represents a double that has the identical bit pattern to the bit pattern of the double represented by this object. For this purpose, two double values are considered to be the same if and only if the method doubleToLongBits(double) returns the same long value when applied to each