The example shows all three methods being invoked but the toString() and valueOf() are masked. Note that by masking toString(), valueOf() is affected too. That may not be common to all object types.
There are other similar methods to support different Java primitive data types when they are encapsulated in an object. Only this one is illustraed. The others are different only in the data type and the name they have.