Nope. Try again.
From the API document, it inherence equals() method from java.lang.Object. So it probably do the samething as what Object.equals() does...If the class define it own equals, it probably have it own equals() method show at the API document http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#equals(java.lang.Object)And I guess, we should already read the API document? http://java.sun.com/j2se/1.4.2/docs/api/java/math/BigDecimal.html#BigDecimal(double)
C'mon guys, there's really only one other answer to the question :)I'll hive you a hint ... not true . But you're gonna have to explain why to get the cool points on this one!
False - AtomicInteger is not an Integer, they are for use when updating integers concurrently. So it should be false, however one.intValue().equals(two.intValue()) should return true.-suresh
suresh, you are correct my friend.AtomicInteger.equals uses instance equality because it is inherited from Object. I would assume this is by design.The same for AtomicBoolean and AtomicLong as well.
Post a Comment