In the following code, how is toString() is implicitly called?
toString()
class Payload { private int weight; public Payload (int w) { weig
This is just a language feature which is available for free. See Concatenating strings section:
Such a concatenation can be a mixture of any objects. For each object that is not a String, its toString() method is called to convert it to a String.