Explicit vs implicit call of toString
There’s little difference. Use the one that’s shorter and works more often. If you actually want to get the string value of an object for other reasons, and want it to be null friendly, do this: String s = String.valueOf(obj); Edit: The question was extended, so I’ll extend my answer. In both cases, they compile … Read more