The thing is that Integer.valueOf(
String)
always returns a
new Integer while Boolean.valueOf(String) uses the constants Boolean.TRUE and Boolean.FALSE every time you invoke it.
Therefore, Boolean.valueOf(String) always returns the same object. That is not the case of Integer.valueOf(String).
Something similiar happens if you use Integer.valueOf(int), since the first 128 Integers are cached.
In this case a and b are the same object, while c and d are different objects.
[ December 21, 2006: Message edited by: Edwin Dalorzo ]