In Java, is there any difference between
According to the Java documentation
if the argument is null, then a string equal to "null"; otherwise, the value of obj.toString() is returned.
So there shouldn't really be a difference except for an additional method invocation.
Also, in case of
Object#toString, if the instance is
NullPointerException will be thrown, so, arguably, it's less safe.