posted 20 years ago
hi, Vineela:
An interesting question. :-)
The 2 of overloaded Boolean.valueOf() methods both return Boolean.TRUE or Boolean.FALSE, which are static final field of class Boolean. Since they are static, there is only one copy per class. Using "==" refers to the same object on the heap.
Long.valueOf() will return a new Long object, so using "==" returns false.