The default implementation of .equals.equals for the ObjectObject class is as you mentioned.
Other classes can override this behavior. StringBuilder StringBuilder is not one of them.
String is one of them, which overrides it to ensure that the String representations of both objects result in the same sequence of characters. String API
Refer to the documentation for the specific object in question.