Originally posted by wang weixin:
i think b1==b2 should by false,and b1.equals(b2) should be true
Your statement is correct if b1 and b2 are created using the Boolean constructor as shown in the code posted by narasimha.
If references b1 and b2 are assigned using the return values of the Boolean.valueOf method (see the code that I posted) then the expression b1==b2 evaluates to true.