All three lines
test object equality, not
string equality. That's why they're mutually not equal.
Note that StringBuffer does not override the
equals method, and thus uses the one inherited from Object (which tests for object equality). The String class, on the other hand, overrides equals to test for string equality.
Something like "s1.toString().equals(s2.toString())" might give you the result you were expecting.
PS: Which, as I now see, is just about what Joanne and Carl said. Oh well.
[ July 03, 2008: Message edited by: Ulf Dittmer ]